syncfusion/blazor-ui-components-skills / skills/syncfusion-blazor-rich-text-editor
syncfusion-blazor-rich-text-editor
VerifiedImplements 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.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 11.1 KB |
| references/accessibility-globalization.md | markdown | 6.7 KB |
| references/built-in-tools.md | markdown | 6.7 KB |
| references/custom-tools.md | markdown | 9.1 KB |
| references/data-binding.md | markdown | 4.6 KB |
| references/editor-modes.md | markdown | 5.8 KB |
| references/events.md | markdown | 23.6 KB |
| references/getting-started.md | markdown | 4.9 KB |
| references/images-and-media.md | markdown | 7.2 KB |
| references/import-export.md | markdown | 8.1 KB |
| references/inline-mode.md | markdown | 4.3 KB |
| references/methods.md | markdown | 10.3 KB |
| references/paste-and-cleanup.md | markdown | 6.7 KB |
| references/properties.md | markdown | 12.2 KB |
| references/tables.md | markdown | 8.1 KB |
| references/text-formatting.md | markdown | 7.0 KB |
| references/toolbar.md | markdown | 6.9 KB |
references/toolbar.md
View on GitHub# Toolbar Configuration in Blazor Rich Text Editor
## Table of Contents
- [Enabling / Disabling the Toolbar](#enabling--disabling-the-toolbar)
- [Toolbar Types](#toolbar-types)
- [Floating Toolbar](#floating-toolbar)
- [Toolbar Position](#toolbar-position)
- [Configuring Toolbar Items](#configuring-toolbar-items)
---
## Enabling / Disabling the Toolbar
### `Enable` — `bool` — default: `true`
Specifies whether to render the toolbar in the Rich Text Editor. When set to `false`, the toolbar is hidden entirely and no editing controls are displayed.
**Hide the toolbar (render editor without any toolbar):**
```razor
<SfRichTextEditor>
<RichTextEditorToolbarSettings Enable="false" />
</SfRichTextEditor>
```
**Show the toolbar (default behaviour — no need to set explicitly):**
```razor
<SfRichTextEditor>
<RichTextEditorToolbarSettings Enable="true" />
</SfRichTextEditor>
```
> **Tip:** Use `Enable="false"` for read-only display scenarios. For a fully non-interactive editor, combine with `Readonly="true"` on `SfRichTextEditor`.
```razor
<!-- Read-only editor with no toolbar -->
<SfRichTextEditor Value="@HtmlContent" Readonly="true">
<RichTextEditorToolbarSettings Enable="false" />
</SfRichTextEditor>
```
---
## Toolbar Types
Set the toolbar layout using `RichTextEditorToolbarSettings.Type`. Four types are available:
### Expand (default)
Overflowing items are hidden and revealed via an expand arrow:
```razor
<SfRichTextEditor>
<RichTextEditorToolbarSettings Type="ToolbarType.Expand" />
</SfRichTextEditor>
```
### MultiRow
All items always visible across multiple rows:
```razor
<SfRichTextEditor>
<RichTextEditorToolbarSettings Type="ToolbarType.MultiRow" />
</SfRichTextEditor>
```
### Scrollable
Single row with horizontal scrolling for overflow items:
```razor
<SfRichTextEditor>
<RichTextEditorToolbarSettings Type="ToolbarType.Scrollable" />
</SfRichTextEditor>
```
### Popup
Items overflow into a popup container — good for limited screen space:
```razor
<SfRichTextEditor>
<RichTextEditorToolbarSettings Type="ToolbarType.Popup" />
</SfRichTextEditor>
```
> **Choosing a type:** Use `Expand` for most apps. Use `MultiRow` when you want all tools always visible. Use `Scrollable` on mobile-friendly layouts. Use `Popup` for very compact UIs.
---
## Floating Toolbar
By default, the toolbar floats (stays visible) when scrolling through a tall editor. Control this with `EnableFloating` and `FloatingToolbarOffset`.
**Disable floating (toolbar scrolls away with content):**
```razor
<SfRichTextEditor Height="800px">
<RichTextEditorToolbarSettings EnableFloating="false" />
</SfRichTextEditor>
```
**Float with offset from top of viewport (e.g., to clear a fixed header):**
```razor
<SfRichTextEditor Height="800px">
<RichTextEditorToolbarSettings EnableFloating="true" />
<!-- FloatingToolbarOffset is a property on SfRichTextEditor, not toolbar settings -->
</SfRichTextEditor>
```
```razor
<SfRichTextEditor Height="800px" FloatingToolbarOffset="60">
<RichTextEditorToolbarSettings EnableFloating="true" />
</SfRichTextEditor>
```
> Set `FloatingToolbarOffset` to match your fixed header height (in pixels) to prevent toolbar overlap.
---
## Toolbar Position
Place the toolbar above or below the content area:
**Bottom toolbar:**
```razor
<SfRichTextEditor>
<RichTextEditorToolbarSettings Position="ToolbarPosition.Bottom" />
</SfRichTextEditor>
```
**Top toolbar (default):**
```razor
<SfRichTextEditor>
<RichTextEditorToolbarSettings Position="ToolbarPosition.Top" />
</SfRichTextEditor>
```
> Bottom toolbar is useful for chat-style or mobile editors where the content should lead.
---
## Configuring Toolbar Items
Use `RichTextEditorToolbarSettings.Items` to define which tools appear and in what order. Each item is a `ToolbarItemModel`.
**Standard item:**
```csharp
new ToolbarItemModel() { Command = ToolbarCommand.Bold }
```
**Separator (visual divider between groups):**
```csharp
new ToolbarItemModel() { Command = ToolbarCommand.Separator }
```
**Full example with grouped items:**
```razor
<SfRichTextEditor>
<RichTextEditorToolbarSettings Items="@Tools" />
</SfRichTextEditor>
@code {
private List<ToolbarItemModel> Tools = new()
{
// Text formatting group
new() { Command = ToolbarCommand.Bold },
new() { Command = ToolbarCommand.Italic },
new() { Command = ToolbarCommand.Underline },
new() { Command = ToolbarCommand.Separator },
// Font group
new() { Command = ToolbarCommand.FontName },
new() { Command = ToolbarCommand.FontSize },
new() { Command = ToolbarCommand.FontColor },
new() { Command = ToolbarCommand.BackgroundColor },
new() { Command = ToolbarCommand.Separator },
// Block group
new() { Command = ToolbarCommand.Formats },
new() { Command = ToolbarCommand.Alignments },
new() { Command = ToolbarCommand.OrderedList },
new() { Command = ToolbarCommand.UnorderedList },
new() { Command = ToolbarCommand.Separator },
// Insert group
new() { Command = ToolbarCommand.CreateLink },
new() { Command = ToolbarCommand.Image },
new() { Command = ToolbarCommand.CreateTable },
new() { Command = ToolbarCommand.Separator },
// Utility group
new() { Command = ToolbarCommand.SourceCode },
new() { Command = ToolbarCommand.FullScreen },
new() { Command = ToolbarCommand.Separator },
new() { Command = ToolbarCommand.Undo },
new() { Command = ToolbarCommand.Redo }
};
}
```
### Adding a custom toolbar item
Custom items use the `Name` property and require a matching `RichTextEditorCustomToolbarItem`:
```razor
<SfRichTextEditor @ref="RteObj">
<RichTextEditorToolbarSettings Items="@Tools">
<RichTextEditorCustomToolbarItems>
<RichTextEditorCustomToolbarItem Name="MyTool">
<Template>
<button @onclick="OnMyToolClick">★ Star</button>
</Template>
</RichTextEditorCustomToolbarItem>
</RichTextEditorCustomToolbarItems>
</RichTextEditorToolbarSettings>
</SfRichTextEditor>
@code {
private SfRichTextEditor RteObj;
private List<ToolbarItemModel> Tools = new()
{
new() { Command = ToolbarCommand.Bold },
new() { Name = "MyTool", TooltipText = "Insert Star" }
};
private async Task OnMyToolClick()
{
await RteObj.ExecuteCommandAsync(CommandName.InsertText, "★",
new ExecuteCommandOption { Undo = true });
}
}
```
### Enable/disable toolbar items programmatically
```csharp
// Enable an item
await RteObj.EnableToolbarItemAsync(new List<ToolbarItemModel>
{
new() { Command = ToolbarCommand.Bold }
});
// Disable an item
await RteObj.DisableToolbarItemAsync(new List<ToolbarItemModel>
{
new() { Command = ToolbarCommand.Bold }
});
```
> Add `Command = ToolbarCommand.Custom` to include custom toolbar items in enable/disable operations.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |