Keyboard support in Blazor RichTextEditor Component

7 Dec 20238 minutes to read

The editor has full keyboard accessibility that includes shortcuts to open and other actions with toolbar items, drop-down lists, and dialogs.

HTML formation shortcut key

You can use the following key shortcuts when the Rich Text Editor renders with HTML editMode.

Actions Keyboard shortcuts
Toolbar focus ALT + F10
Insert link CTRL + K
Insert image CTRL + SHIFT + I
Insert audio Ctrl + Shift + a
Insert video Ctrl + Alt + v
Insert table CTRL + SHIFT + E
Undo CTRL + Z
Redo CTRL + Y
Copy CTRL + C
Cut CTRL + X
Paste CTRL + V
Bold CTRL + B
Italic CTRL + I
Underline CTRL + U
Strikethrough CTRL + SHIFT + S
Uppercase CTRL + SHIFT + U
Lowercase CTRL + SHIFT + L
Superscript CTRL + SHIFT + =
Subscript CTRL + =
Indents CTRL + ]
Outdents CTRL + [
HTML source CTRL + SHIFT + H
Full screen CTRL + SHIFT + F
Exit Full screen Esc
Justify center CTRL + E
Justify full CTRL + `J
Justify left CTRL + L
Justify right CTRL + R
Clear format CTRL + SHIFT + R
Ordered list CTRL + SHIFT + O
Unordered list CTRL + ALT + O

Markdown formation shortcut key

You can use the following key shortcuts when the Rich Text Editor renders with Markdown editMode.

Actions Keyboard shortcuts
Toolbar focus ALT + F10
Insert link CTRL + K
Insert image CTRL + SHIFT + I
Insert table CTRL + SHIFT + E
Undo CTRL + Z
Redo CTRL + Y
Copy CTRL + C
Cut CTRL + X
Paste CTRL + V
Bold CTRL + B
Italic CTRL + i
Strikethrough CTRL + SHIFT + S
Uppercase CTRL + SHIFT + U
Lowercase CTRL + SHIFT + L
Superscript CTRL + SHIFT + =
Subscript CTRL + =
Full screen CTRL + SHIFT + F
Exit Full screen Esc
Ordered list CTRL + SHIFT + O
Unordered list CTRL + ALT + O
@using Syncfusion.Blazor.RichTextEditor

<SfRichTextEditor EditorMode="EditorMode.Markdown">
    <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>
    <li><p> Contains a modular library to load the necessary functionality on demand.</p></li>
    <li><p> Provides a fully customizable toolbar.</p></li><li><p> Provides HTML view to edit the source directly for developers.</p></li>
    <li><p> Supports third - party library integration.</p></li>
    <li><p> Allows preview of modified content before saving it.</p></li>
    </ul>
</SfRichTextEditor>

Blazor RichTextEditor with Key Configuration

Custom key config

Customize the key config for the keyboard interaction of Rich Text Editor, using the KeyConfigure property.

In the following code block, customize the bold and italic, toolbar actions with ctrl+1, ctrl+2 respectively.

@using Syncfusion.Blazor.RichTextEditor

<SfRichTextEditor KeyConfigure="@KeyConfig">
    <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>
    <li><p> Contains a modular library to load the necessary functionality on demand.</p></li>
    <li><p> Provides a fully customizable toolbar.</p></li>
    <li><p> Provides HTML view to edit the source directly for developers.</p></li>
    <li><p> Supports third - party library integration.</p></li>
    <li><p> Allows preview of modified content before saving it.</p></li>
    </ul>
</SfRichTextEditor>

@code {
    private ShortcutKeys KeyConfig = new ShortcutKeys()
    {
        Bold = "ctrl+1",
        Italic = "ctrl+2"
    };
}

NOTE

You can refer to our Blazor Rich Text Editor feature tour page for its groundbreaking feature representations. You can also explore our Blazor Rich Text Editor example to know how to render and configureĀ the rich text editor tools.

See also