Skip to content

syncfusion/blazor-ui-components-skills / skills/syncfusion-blazor-rich-text-editor

syncfusion-blazor-rich-text-editor

Verified

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.

references/inline-mode.md

View on GitHub
# Inline Mode

## Table of Contents
- [Overview](#overview)
- [Enabling Inline Mode](#enabling-inline-mode)
- [Show Toolbar on Selection Only](#show-toolbar-on-selection-only)
- [Customising the Inline Toolbar Items](#customising-the-inline-toolbar-items)
- [Use Cases](#use-cases)

---

## Overview

Inline mode hides the toolbar by default and shows a **floating toolbar** when the user focuses or selects text inside the editor. It is ideal for in-place editing scenarios where the toolbar should not take up permanent screen real estate.

---

## Enabling Inline Mode

Add `<RichTextEditorInlineMode Enable="true" />` inside the editor. The toolbar appears as soon as the user clicks into the editable area:

```razor
@using Syncfusion.Blazor.RichTextEditor

<SfRichTextEditor>
    <RichTextEditorInlineMode Enable="true" ShowOnSelection="false" />
    <p>
        The editor is in inline mode. Click anywhere in this text to reveal the
        formatting toolbar.
    </p>
</SfRichTextEditor>
```

| Property | Type | Default | Description |
|---|---|---|---|
| `Enable` | `bool` | `false` | Activates inline (floating) toolbar mode |
| `ShowOnSelection` | `bool` | `false` | When `true`, toolbar only appears when text is selected (not on focus) |

---

## Show Toolbar on Selection Only

Set `ShowOnSelection="true"` to keep the toolbar hidden until the user actually selects some text. This is the most unobtrusive option:

```razor
<SfRichTextEditor>
    <RichTextEditorToolbarSettings Items="@Tools" />
    <RichTextEditorInlineMode Enable="true" ShowOnSelection="true" />
    <p>
        Select any text in this paragraph to see the inline formatting toolbar appear
        at the cursor.
    </p>
</SfRichTextEditor>

@code {
    private List<ToolbarItemModel> Tools = new()
    {
        new() { Command = ToolbarCommand.Bold },
        new() { Command = ToolbarCommand.Italic },
        new() { Command = ToolbarCommand.Underline },
        new() { Command = ToolbarCommand.Separator },
        new() { Command = ToolbarCommand.CreateLink },
        new() { Command = ToolbarCommand.Image }
    };
}
```

> The floating toolbar anchors near the selection and repositions automatically when the user scrolls or the selection changes.

---

## Customising the Inline Toolbar Items

Inline mode uses the same `RichTextEditorToolbarSettings.Items` list as regular mode. Limit the list to frequently used commands to keep the floating bar compact:

```razor
<SfRichTextEditor>
    <RichTextEditorToolbarSettings Items="@InlineTools" />
    <RichTextEditorInlineMode Enable="true" ShowOnSelection="true" />
    <p>Rich in-place editing with a minimal floating toolbar.</p>
</SfRichTextEditor>

@code {
    private List<ToolbarItemModel> InlineTools = new()
    {
        new() { Command = ToolbarCommand.Bold },
        new() { Command = ToolbarCommand.Italic },
        new() { Command = ToolbarCommand.Underline },
        new() { Command = ToolbarCommand.StrikeThrough },
        new() { Command = ToolbarCommand.Separator },
        new() { Command = ToolbarCommand.FontColor },
        new() { Command = ToolbarCommand.BackgroundColor },
        new() { Command = ToolbarCommand.Separator },
        new() { Command = ToolbarCommand.Alignments },
        new() { Command = ToolbarCommand.Separator },
        new() { Command = ToolbarCommand.CreateLink },
        new() { Command = ToolbarCommand.ClearFormat }
    };
}
```

---

## Use Cases

| Scenario | Recommended Configuration |
|---|---|
| Blog post editor with minimal UI | `Enable="true"`, `ShowOnSelection="false"` |
| Document viewer with in-place annotation | `Enable="true"`, `ShowOnSelection="true"` |
| Comment / note editing inside a card | `Enable="true"`, `ShowOnSelection="true"` + condensed `Items` list |
| Full-page content editor | Standard mode (no `RichTextEditorInlineMode`) |

> Inline mode can be combined with a **read-only** initial state. Use `Readonly="true"` by default and programmatically toggle it on a double-click via `@ref` to create a click-to-edit pattern.

```razor
<SfRichTextEditor @ref="Rte" Readonly="@IsReadonly" @ondblclick="EnableEdit">
    <RichTextEditorInlineMode Enable="true" ShowOnSelection="true" />
    <p>Double-click to start editing.</p>
</SfRichTextEditor>

@code {
    private SfRichTextEditor Rte = default!;
    private bool IsReadonly = true;

    private void EnableEdit() => IsReadonly = false;
}
```
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall