Syncfusion Blazor Rich Text Editor
A comprehensive skill for implementing and configuring the Syncfusion Blazor Rich Text Editor (SfRichTextEditor) — a full-featured WYSIWYG editor supporting HTML and Markdown editing, rich toolbar customization, media insertion, tables, data binding, import/export, and accessibility.
When to Use This Skill
Use this skill when the user needs to:
- Install and set up
SfRichTextEditor in a Blazor Server, WebAssembly, or Web App project
- Configure toolbar items, toolbar types (Expand, MultiRow, Scrollable, Popup), or toolbar position
- Format text: bold/italic/underline, headings, lists, alignment, colors, fonts, line height
- Insert and manage images, videos, or audio with upload support
- Work with tables: insert, resize, merge cells, customize quick toolbar
- Switch between HTML, Markdown, or IFrame editor modes
- Enable inline editing (inline toolbar)
- Add custom toolbar tools or use exec commands
- Handle RTE events (
ValueChange, OnActionBegin, image upload events, etc.)
- Bind content two-way with
@bind-Value or retrieve via GetTextAsync
- Configure paste cleanup behavior
- Import from Word / export to Word or PDF
- Implement accessibility, keyboard shortcuts, RTL, or globalization
Quick Start
1. Install NuGet packages:
dotnet add package Syncfusion.Blazor.RichTextEditor
dotnet add package Syncfusion.Blazor.Themes
2. Register in Program.cs:
using Syncfusion.Blazor;
builder.Services.AddSyncfusionBlazor();
3. Add to _Imports.razor:
@using Syncfusion.Blazor
@using Syncfusion.Blazor.RichTextEditor
4. Add CSS/JS in index.html (WASM) or App.razor (Server):
<link href="_content/Syncfusion.Blazor.Themes/bootstrap5.css" rel="stylesheet" />
<script src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js"></script>
5. Add the component:
<SfRichTextEditor @bind-Value="@Content">
<RichTextEditorToolbarSettings Items="@Tools" />
</SfRichTextEditor>
@code {
private string Content { get; set; } = "<p>Start editing...</p>";
private List<ToolbarItemModel> Tools = new()
{
new() { Command = ToolbarCommand.Bold },
new() { Command = ToolbarCommand.Italic },
new() { Command = ToolbarCommand.Underline },
new() { Command = ToolbarCommand.Separator },
new() { Command = ToolbarCommand.Formats },
new() { Command = ToolbarCommand.Alignments },
new() { Command = ToolbarCommand.OrderedList },
new() { Command = ToolbarCommand.UnorderedList },
new() { Command = ToolbarCommand.Separator },
new() { Command = ToolbarCommand.CreateLink },
new() { Command = ToolbarCommand.Image },
new() { Command = ToolbarCommand.CreateTable },
new() { Command = ToolbarCommand.Separator },
new() { Command = ToolbarCommand.Undo },
new() { Command = ToolbarCommand.Redo }
};
}
Navigation Guide
Getting Started & Setup
📄 Read: references/getting-started.md
- NuGet installation for all project types (Visual Studio, VS Code, .NET CLI)
- Service registration and namespace imports
- CSS theme and JS script references
- Adding the first component to a page
- Retrieving content as HTML, plain text, or character count
Toolbar Configuration
📄 Read: references/toolbar.md
- Enabling or disabling the toolbar with
RichTextEditorToolbarSettings.Enable
- Toolbar types: Expand, MultiRow, Scrollable, Popup
- Floating toolbar and offset configuration
- Toolbar position (top or bottom)
- Configuring toolbar items with
ToolbarItemModel
- Custom toolbar items (template-based)
Built-in Toolbar Tools Reference
📄 Read: references/built-in-tools.md
- Complete list of all
ToolbarCommand enum values
- Text formatting, font & styling, alignment, lists, hyperlinks
- Image/table/link quick toolbar item commands
- Undo/redo, fullscreen, print, source code, preview tools
- Removing or reordering default toolbar items
Text Formatting
📄 Read: references/text-formatting.md
- Bold, italic, underline, strikethrough, subscript, superscript, inline code
- Text alignment (left, center, right, justify)
- Ordered/unordered lists with custom number and bullet styles
- Heading formats (H1–H6, paragraph, blockquote, code)
- Line height configuration
- Horizontal line, format painter, clear format
- Markdown auto-format (inline and block shortcuts)
Images, Video & Audio
📄 Read: references/images-and-media.md
- Image insertion from local machine or URL
RichTextEditorImageSettings: SaveUrl, Path, AllowedTypes, EnableResize
- Base64 vs server-side upload
- Image quick toolbar configuration
- Video and audio insertion and settings
Tables
📄 Read: references/tables.md
- Creating tables with
CreateTable toolbar item
RichTextEditorTableSettings: width, resize, custom styles
- Table quick toolbar: add/remove rows & columns, merge cells, properties
- Advanced table manipulation (cell selection, split, custom borders)
Editor Modes
📄 Read: references/editor-modes.md
- HTML editor mode (default WYSIWYG)
- Markdown editor mode (
EditorMode.Markdown)
- IFrame vs DIV rendering mode
- Source code view toggling
Inline Mode
📄 Read: references/inline-mode.md
- Enabling inline toolbar (
InlineMode)
- Inline toolbar display on text selection
- Use cases: comment editors, in-place content editing
Custom Tools & Exec Commands
📄 Read: references/custom-tools.md
- Adding custom toolbar buttons with
ToolbarItemModel and templates
- Executing commands programmatically with
ExecuteCommandAsync
- Slash commands (
/ trigger menu) configuration
- Format painter advanced settings (
RichTextEditorFormatPainterSettings)
Events
📄 Read: references/events.md
RichTextEditorEvents child component usage and wiring pattern
- Lifecycle events:
Created, Destroyed
- Focus/interaction:
Focus, Blur, OnToolbarClick, SelectionChanged
- Content events:
ValueChange, BeforePasteCleanup, AfterPasteCleanup
- Toolbar lifecycle:
OnActionBegin, OnActionComplete
- Dialog events:
OnDialogOpen, DialogOpened, OnDialogClose, DialogClosed
- Quick toolbar:
OnQuickToolbarOpen, QuickToolbarOpened, QuickToolbarClosed
- Image events:
OnImageSelected, BeforeUploadImage, OnImageUploadSuccess, OnImageUploadFailed, ImageUploadChange, OnImageDrop, ImageDelete
- Media events:
FileSelected, FileUploading, FileUploadSuccess, FileUploadFailed, FileUploadChange, OnMediaDrop, MediaDeleted
- Resize events:
OnResizeStart, OnResizeStop
- Toolbar status:
UpdatedToolbarStatus
- Export events:
OnExport, OnExportFailure
- Slash menu:
SlashMenuItemSelecting
- Complete EventArgs class reference with all properties
Methods
📄 Read: references/methods.md
- Focus & selection:
FocusAsync, FocusOutAsync, SaveSelectionAsync, RestoreSelectionAsync, SelectAllAsync, GetSelectionAsync
- Content retrieval:
GetTextAsync, GetSelectedHtmlAsync, GetCharCountAsync, GetXhtmlAsync
- Command execution: all
ExecuteCommandAsync overloads with typed args (image, link, table, video, audio, code block, format painter)
- Toolbar control:
EnableToolbarItem, DisableToolbarItem, RemoveToolbarItem
- Dialog & UI control:
ShowDialogAsync, CloseDialogAsync, ShowFullScreenAsync, PrintAsync, RefreshUIAsync, ShowSourceCodeAsync
- Undo/redo:
ClearUndoRedoAsync
- Full
CommandName, ToolbarCommand, and DialogType enum references
Properties
📄 Read: references/properties.md
- Content & value:
Value, Placeholder, Readonly, Enabled, MaxLength, ShowCharCount
- Editor behaviour:
EditorMode, EnterKey, ShiftEnterKey, EnableTabKey, EnableAutoUrl, EnableMarkdownAutoFormat, EnableClipboardCleanup, EnableXhtml, EnableHtmlEncode, EnableResize, EnableChunkMessages
- Appearance & layout:
Height, Width, CssClass, ShowTooltip, FloatingToolbarOffset
- Security & sanitization:
EnableHtmlSanitizer, AdditionalSanitizeAttributes, AdditionalSanitizeTags, DeniedSanitizeSelectors
- Keyboard & shortcuts:
KeyConfigure with full ShortcutKeys default bindings table
- Persistence & auto-save:
EnablePersistence, SaveInterval, AutoSaveOnIdle
- Undo/redo config:
UndoRedoSteps, UndoRedoTimer
- HTTP integration:
HttpClientInstance
- Full 37-property summary table
Data Binding & Value Management
📄 Read: references/data-binding.md
- Two-way binding with
@bind-Value
- One-way binding and programmatic value updates
ValueChange event for detecting edits
- Read-only mode (
Readonly property)
- Max length enforcement and character count display
Paste Cleanup
📄 Read: references/paste-and-cleanup.md
RichTextEditorPasteCleanupSettings configuration
- Stripping/keeping specific HTML attributes and styles on paste
- Forcing plain text paste
- Enter key behavior (
EnterKey, ShiftEnterKey)
- Undo/redo manager configuration
Import & Export
📄 Read: references/import-export.md
- Importing Word documents into the editor
- Exporting content to Word (.docx) and PDF
- HTTP client configuration for import/export services
- Mail merge with dynamic data
- WebAssembly performance optimizations for large documents
Accessibility & Globalization
📄 Read: references/accessibility-globalization.md
- WCAG 2.1 compliance details
- Keyboard shortcuts and navigation reference
- ARIA roles and screen reader support
- RTL layout (
EnableRtl)
- Localization and culture configuration
- XHTML validation
Common Patterns
Two-way bound editor with character count
<SfRichTextEditor @bind-Value="@HtmlContent" ShowCharCount="true" MaxLength="2000">
</SfRichTextEditor>
@code {
private string HtmlContent { get; set; } = string.Empty;
}
Read-only display
<SfRichTextEditor Value="@HtmlContent" Readonly="true">
<RichTextEditorToolbarSettings Enable="false" />
</SfRichTextEditor>
Markdown editor mode
<SfRichTextEditor EditorMode="EditorMode.Markdown" @bind-Value="@MarkdownContent">
</SfRichTextEditor>
@code {
private string MarkdownContent { get; set; } = "**Hello** world!";
}
1---2name: syncfusion-blazor-rich-text-editor3description: Implements the Syncfusion Blazor Rich Text Editor (SfRichTextEditor) from Syncfusion.Blazor.RichTextEditor. Supports HTML, Markdown, and IFrame editor modes. Use this skills for toolbar configuration, image/video/audio insertion, table management, paste cleanup, import/export Word/PDF, accessibility, globalization, RTL, and inline or custom toolbar tool scenarios in Blazor applications.4---5
6# Syncfusion Blazor Rich Text Editor
7
8A comprehensive skill for implementing and configuring the **Syncfusion Blazor Rich Text Editor** (`SfRichTextEditor`) — a full-featured WYSIWYG editor supporting HTML and Markdown editing, rich toolbar customization, media insertion, tables, data binding, import/export, and accessibility.
9
10## When to Use This Skill
11
12Use this skill when the user needs to:
13- Install and set up `SfRichTextEditor` in a Blazor Server, WebAssembly, or Web App project
14- Configure toolbar items, toolbar types (Expand, MultiRow, Scrollable, Popup), or toolbar position
15- Format text: bold/italic/underline, headings, lists, alignment, colors, fonts, line height
16- Insert and manage images, videos, or audio with upload support
17- Work with tables: insert, resize, merge cells, customize quick toolbar
18- Switch between HTML, Markdown, or IFrame editor modes
19- Enable inline editing (inline toolbar)
20- Add custom toolbar tools or use exec commands
21- Handle RTE events (`ValueChange`, `OnActionBegin`, image upload events, etc.)
22- Bind content two-way with `@bind-Value` or retrieve via `GetTextAsync`
23- Configure paste cleanup behavior
24- Import from Word / export to Word or PDF
25- Implement accessibility, keyboard shortcuts, RTL, or globalization
26
27## Quick Start
28
29**1. Install NuGet packages:**
30```bash
31dotnet add package Syncfusion.Blazor.RichTextEditor
32dotnet add package Syncfusion.Blazor.Themes
33```
34
35**2. Register in `Program.cs`:**
36```csharp
37using Syncfusion.Blazor;
38builder.Services.AddSyncfusionBlazor();
39```
40
41**3. Add to `_Imports.razor`:**
42```razor
43@using Syncfusion.Blazor
44@using Syncfusion.Blazor.RichTextEditor
45```
46
47**4. Add CSS/JS in `index.html` (WASM) or `App.razor` (Server):**
48```html
49<link href="_content/Syncfusion.Blazor.Themes/bootstrap5.css" rel="stylesheet" />
50<script src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js"></script>
51```
52
53**5. Add the component:**
54```razor
55<SfRichTextEditor @bind-Value="@Content">
56 <RichTextEditorToolbarSettings Items="@Tools" />
57</SfRichTextEditor>
58
59@code {
60 private string Content { get; set; } = "<p>Start editing...</p>";
61
62 private List<ToolbarItemModel> Tools = new()
63 {
64 new() { Command = ToolbarCommand.Bold },
65 new() { Command = ToolbarCommand.Italic },
66 new() { Command = ToolbarCommand.Underline },
67 new() { Command = ToolbarCommand.Separator },
68 new() { Command = ToolbarCommand.Formats },
69 new() { Command = ToolbarCommand.Alignments },
70 new() { Command = ToolbarCommand.OrderedList },
71 new() { Command = ToolbarCommand.UnorderedList },
72 new() { Command = ToolbarCommand.Separator },
73 new() { Command = ToolbarCommand.CreateLink },
74 new() { Command = ToolbarCommand.Image },
75 new() { Command = ToolbarCommand.CreateTable },
76 new() { Command = ToolbarCommand.Separator },
77 new() { Command = ToolbarCommand.Undo },
78 new() { Command = ToolbarCommand.Redo }
79 };
80}
81```
82
83## Navigation Guide
84
85### Getting Started & Setup
86📄 **Read:** [references/getting-started.md](references/getting-started.md)
87- NuGet installation for all project types (Visual Studio, VS Code, .NET CLI)
88- Service registration and namespace imports
89- CSS theme and JS script references
90- Adding the first component to a page
91- Retrieving content as HTML, plain text, or character count
92
93### Toolbar Configuration
94📄 **Read:** [references/toolbar.md](references/toolbar.md)
95- Enabling or disabling the toolbar with `RichTextEditorToolbarSettings.Enable`
96- Toolbar types: Expand, MultiRow, Scrollable, Popup
97- Floating toolbar and offset configuration
98- Toolbar position (top or bottom)
99- Configuring toolbar items with `ToolbarItemModel`
100- Custom toolbar items (template-based)
101
102### Built-in Toolbar Tools Reference
103📄 **Read:** [references/built-in-tools.md](references/built-in-tools.md)
104- Complete list of all `ToolbarCommand` enum values
105- Text formatting, font & styling, alignment, lists, hyperlinks
106- Image/table/link quick toolbar item commands
107- Undo/redo, fullscreen, print, source code, preview tools
108- Removing or reordering default toolbar items
109
110### Text Formatting
111📄 **Read:** [references/text-formatting.md](references/text-formatting.md)
112- Bold, italic, underline, strikethrough, subscript, superscript, inline code
113- Text alignment (left, center, right, justify)
114- Ordered/unordered lists with custom number and bullet styles
115- Heading formats (H1–H6, paragraph, blockquote, code)
116- Line height configuration
117- Horizontal line, format painter, clear format
118- Markdown auto-format (inline and block shortcuts)
119
120### Images, Video & Audio
121📄 **Read:** [references/images-and-media.md](references/images-and-media.md)
122- Image insertion from local machine or URL
123- `RichTextEditorImageSettings`: SaveUrl, Path, AllowedTypes, EnableResize
124- Base64 vs server-side upload
125- Image quick toolbar configuration
126- Video and audio insertion and settings
127
128### Tables
129📄 **Read:** [references/tables.md](references/tables.md)
130- Creating tables with `CreateTable` toolbar item
131- `RichTextEditorTableSettings`: width, resize, custom styles
132- Table quick toolbar: add/remove rows & columns, merge cells, properties
133- Advanced table manipulation (cell selection, split, custom borders)
134
135### Editor Modes
136📄 **Read:** [references/editor-modes.md](references/editor-modes.md)
137- HTML editor mode (default WYSIWYG)
138- Markdown editor mode (`EditorMode.Markdown`)
139- IFrame vs DIV rendering mode
140- Source code view toggling
141
142### Inline Mode
143📄 **Read:** [references/inline-mode.md](references/inline-mode.md)
144- Enabling inline toolbar (`InlineMode`)
145- Inline toolbar display on text selection
146- Use cases: comment editors, in-place content editing
147
148### Custom Tools & Exec Commands
149📄 **Read:** [references/custom-tools.md](references/custom-tools.md)
150- Adding custom toolbar buttons with `ToolbarItemModel` and templates
151- Executing commands programmatically with `ExecuteCommandAsync`
152- Slash commands (`/` trigger menu) configuration
153- Format painter advanced settings (`RichTextEditorFormatPainterSettings`)
154
155### Events
156📄 **Read:** [references/events.md](references/events.md)
157- `RichTextEditorEvents` child component usage and wiring pattern
158- Lifecycle events: `Created`, `Destroyed`
159- Focus/interaction: `Focus`, `Blur`, `OnToolbarClick`, `SelectionChanged`
160- Content events: `ValueChange`, `BeforePasteCleanup`, `AfterPasteCleanup`
161- Toolbar lifecycle: `OnActionBegin`, `OnActionComplete`
162- Dialog events: `OnDialogOpen`, `DialogOpened`, `OnDialogClose`, `DialogClosed`
163- Quick toolbar: `OnQuickToolbarOpen`, `QuickToolbarOpened`, `QuickToolbarClosed`
164- Image events: `OnImageSelected`, `BeforeUploadImage`, `OnImageUploadSuccess`, `OnImageUploadFailed`, `ImageUploadChange`, `OnImageDrop`, `ImageDelete`
165- Media events: `FileSelected`, `FileUploading`, `FileUploadSuccess`, `FileUploadFailed`, `FileUploadChange`, `OnMediaDrop`, `MediaDeleted`
166- Resize events: `OnResizeStart`, `OnResizeStop`
167- Toolbar status: `UpdatedToolbarStatus`
168- Export events: `OnExport`, `OnExportFailure`
169- Slash menu: `SlashMenuItemSelecting`
170- Complete EventArgs class reference with all properties
171
172### Methods
173📄 **Read:** [references/methods.md](references/methods.md)
174- Focus & selection: `FocusAsync`, `FocusOutAsync`, `SaveSelectionAsync`, `RestoreSelectionAsync`, `SelectAllAsync`, `GetSelectionAsync`
175- Content retrieval: `GetTextAsync`, `GetSelectedHtmlAsync`, `GetCharCountAsync`, `GetXhtmlAsync`
176- Command execution: all `ExecuteCommandAsync` overloads with typed args (image, link, table, video, audio, code block, format painter)
177- Toolbar control: `EnableToolbarItem`, `DisableToolbarItem`, `RemoveToolbarItem`
178- Dialog & UI control: `ShowDialogAsync`, `CloseDialogAsync`, `ShowFullScreenAsync`, `PrintAsync`, `RefreshUIAsync`, `ShowSourceCodeAsync`
179- Undo/redo: `ClearUndoRedoAsync`
180- Full `CommandName`, `ToolbarCommand`, and `DialogType` enum references
181
182### Properties
183📄 **Read:** [references/properties.md](references/properties.md)
184- Content & value: `Value`, `Placeholder`, `Readonly`, `Enabled`, `MaxLength`, `ShowCharCount`
185- Editor behaviour: `EditorMode`, `EnterKey`, `ShiftEnterKey`, `EnableTabKey`, `EnableAutoUrl`, `EnableMarkdownAutoFormat`, `EnableClipboardCleanup`, `EnableXhtml`, `EnableHtmlEncode`, `EnableResize`, `EnableChunkMessages`
186- Appearance & layout: `Height`, `Width`, `CssClass`, `ShowTooltip`, `FloatingToolbarOffset`
187- Security & sanitization: `EnableHtmlSanitizer`, `AdditionalSanitizeAttributes`, `AdditionalSanitizeTags`, `DeniedSanitizeSelectors`
188- Keyboard & shortcuts: `KeyConfigure` with full `ShortcutKeys` default bindings table
189- Persistence & auto-save: `EnablePersistence`, `SaveInterval`, `AutoSaveOnIdle`
190- Undo/redo config: `UndoRedoSteps`, `UndoRedoTimer`
191- HTTP integration: `HttpClientInstance`
192- Full 37-property summary table
193
194### Data Binding & Value Management
195📄 **Read:** [references/data-binding.md](references/data-binding.md)
196- Two-way binding with `@bind-Value`
197- One-way binding and programmatic value updates
198- `ValueChange` event for detecting edits
199- Read-only mode (`Readonly` property)
200- Max length enforcement and character count display
201
202### Paste Cleanup
203📄 **Read:** [references/paste-and-cleanup.md](references/paste-and-cleanup.md)
204- `RichTextEditorPasteCleanupSettings` configuration
205- Stripping/keeping specific HTML attributes and styles on paste
206- Forcing plain text paste
207- Enter key behavior (`EnterKey`, `ShiftEnterKey`)
208- Undo/redo manager configuration
209
210### Import & Export
211📄 **Read:** [references/import-export.md](references/import-export.md)
212- Importing Word documents into the editor
213- Exporting content to Word (.docx) and PDF
214- HTTP client configuration for import/export services
215- Mail merge with dynamic data
216- WebAssembly performance optimizations for large documents
217
218### Accessibility & Globalization
219📄 **Read:** [references/accessibility-globalization.md](references/accessibility-globalization.md)
220- WCAG 2.1 compliance details
221- Keyboard shortcuts and navigation reference
222- ARIA roles and screen reader support
223- RTL layout (`EnableRtl`)
224- Localization and culture configuration
225- XHTML validation
226
227## Common Patterns
228
229### Two-way bound editor with character count
230```razor
231<SfRichTextEditor @bind-Value="@HtmlContent" ShowCharCount="true" MaxLength="2000">
232</SfRichTextEditor>
233
234@code {
235 private string HtmlContent { get; set; } = string.Empty;
236}
237```
238
239### Read-only display
240```razor
241<SfRichTextEditor Value="@HtmlContent" Readonly="true">
242 <RichTextEditorToolbarSettings Enable="false" />
243</SfRichTextEditor>
244```
245
246### Markdown editor mode
247```razor
248<SfRichTextEditor EditorMode="EditorMode.Markdown" @bind-Value="@MarkdownContent">
249</SfRichTextEditor>
250
251@code {
252 private string MarkdownContent { get; set; } = "**Hello** world!";
253}
254```