Class RichTextEditorCustomToolbarItem
A class used for configuring the custom toolbar item properties in the SfRichTextEditor.
Inheritance
System.Object
RichTextEditorCustomToolbarItem
Namespace: Syncfusion.Blazor.RichTextEditor
Assembly: Syncfusion.Blazor.dll
Syntax
public class RichTextEditorCustomToolbarItem : OwningComponentBase
Examples
In the following example, insert the horizontal line using the custom tool option.
@using Syncfusion.Blazor.RichTextEditor;
<SfRichTextEditor @ref="RTEInstance">
<RichTextEditorToolbarSettings Items="@Tools">
<RichTextEditorCustomToolbarItems>
<RichTextEditorCustomToolbarItem Name="Symbol">
<Template>
<button class="e-btn e-tbar-btn" @onclick="ClickHandler">
<div class="e-tbar-btn-text" style="font-weight: 500;">__</div>
</button>
</Template>
</RichTextEditorCustomToolbarItem>
</RichTextEditorCustomToolbarItems>
</RichTextEditorToolbarSettings>
</SfRichTextEditor>
@code {
SfRichTextEditor RTEInstance;
private List<ToolbarItemModel> Tools = new List<ToolbarItemModel>()
{
new ToolbarItemModel() { Name = "Symbol", TooltipText = "Insert horizontal line" }
};
private async Task ClickHandler() {
await this.RTEInstance.ExecuteCommandAsync(CommandName.InsertHTML, "<hr>");
};
}
Constructors
RichTextEditorCustomToolbarItem()
Declaration
public RichTextEditorCustomToolbarItem()
Properties
Name
Gets or sets the custom tool name.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts a string value. The default value is |
Template
Gets or sets the template to customize the toolbar item.
Declaration
public RenderFragment Template { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.RenderFragment | The template content. The default value in |
Methods
Dispose(Boolean)
Dispose unmanaged resources in the Syncfusion Blazor component.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Boolean value to dispose the object. |
OnInitializedAsync()
Method invoked when the component is ready to start.
Declaration
protected override Task OnInitializedAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A System.Threading.Tasks.Task representing any asynchronous operation. |