Miscellaneous in Blazor Rich Text Editor
Placeholder Text Customization
Defines placeholder text for the Rich Text Editor when the content area is empty using the Placeholder property.
Customize the placeholder’s font style and color using the e-rte-placeholder CSS class.
.e-richtexteditor .e-rte-placeholder {
font-family: monospace;
}The following sample demonstrates the placeholder option in Rich Text Editor.
@using Syncfusion.Blazor.RichTextEditor
<SfRichTextEditor Placeholder="Type something" />
<style>
.e-richtexteditor .e-rte-placeholder {
font-family: monospace;
}
</style>
Character count and limit enforcement
The Rich Text Editor automatically counts the number of characters in the content while typing, using the ShowCharCount property. The characters count displayed at the bottom of the editor. You can limit the number of characters in your content using the MaxLength property. By default, the editor sets the characters limit value to infinity.
The character count indicator changes color based on usage thresholds:
| Status | Description |
|---|---|
| Normal | Till 70% of given maxLength count reach, character count color is black. |
| Warning | Once the number of character count in the Rich Text Editor reached 70% of given maxLength count, the character count color will be orange, indicating that, the Rich Text Editor value going to reach the maximum count. |
| Error | Once the number of character count in the Rich Text Editor reached 90% of given maxLength count, the character count color will be red, indicating that, the Rich Text Editor value reached the maximum count. |
@using Syncfusion.Blazor.RichTextEditor
<SfRichTextEditor ShowCharCount="true" MaxLength="300">
<p>The Rich Text Editor component is WYSIWYG ('what you see is what you get') editor that provides the best user experience to create and update the content. Users can format their content using standard toolbar commands.</p>
<p><b> Key features:</b></p>
<ul>
<li><p> Provides <b>IFRAME</b> and <b>DIV</b> modes </p></li>
<li><p> Capable of handling markdown editing.</p></li>
</ul>
</SfRichTextEditor>
Code view
The Rich Text Editor includes the ability for users to directly edit HTML code via Source View in the text area. If you make any modification in Source view directly, the changes will be reflected in the Rich Text Editor’s content. This gives the user more flexibility over the content they create.
@using Syncfusion.Blazor.RichTextEditor
<SfRichTextEditor>
<p>The Rich Text Editor component is WYSIWYG ('what you see is what you get') editor that provides the best user experience to create and update the content. Users can format their content using standard toolbar commands.</p>
<p><b> Key features:</b></p>
<ul>
<li><p> Provides <b>IFRAME</b> and <b>DIV</b> modes </p></li>
<li><p> Capable of handling markdown editing.</p></li>
</ul>
</SfRichTextEditor>
Number and Bullet Format Lists
This feature allows the user to change the appearance of the numbered and bulleted lists. Users can apply different numbering or bullet formats such as lowercase Greek, upper Alpha, square, and circles. Customize the style types available in the dropdown using the RichTextEditorNumberFormatList and RichTextEditorBulletFormatList settings.
@using Syncfusion.Blazor.RichTextEditor
<SfRichTextEditor>
<RichTextEditorToolbarSettings Items="@Tools" />
<RichTextEditorNumberFormatList Formats="@NumberFormats" />
<RichTextEditorBulletFormatList Formats="@BulletFormats" />
<p>The Rich Text Editor component is WYSIWYG ('what you see is what you get') editor that provides the best user experience.</p>
</SfRichTextEditor>
@code {
private List<ToolbarItemModel> Tools = new List<ToolbarItemModel>()
{
new ToolbarItemModel() { Command = ToolbarCommand.NumberFormatList },
new ToolbarItemModel() { Command = ToolbarCommand.BulletFormatList }
};
private List<string> NumberFormats = new() { "LowerRoman", "LowerAlpha", "Decimal" };
private List<string> BulletFormats = new() { "Disc", "Square", "Circle" };
}