Accessibility in Blazor RichTextEditor

19 Sep 202311 minutes to read

The Rich Text Editor component has been designed with the WAI-ARIA specifications in mind and applies the WAI-ARIA roles, states, and properties along with the keyboard support. This component is characterized by keyboard interaction support and ARIA accessibility support, making it easy for people who use assistive technologies (AT) or those who completely rely on keyboard navigation.

ARIA attributes

The toolbar of the Rich Text Editor has been assigned the role of the toolbar and has the following list of ARIA attributes:

Roles and Attributes Functionalities
role="toolbar" This attribute added to the toolbar element describes the actual role of the element.
aria-orientation Indicates the toolbar orientation. The default value is horizontal.
aria-haspopup Indicates the popup mode of the toolbar. The default value is false. When popup mode is enabled, the attribute value has to be changed to true.
aria-disabled Indicates the disabled state of the toolbar.

For further details of toolbar ARIA attributes, refer to the accessibility of Toolbar documentation.

The Rich Text Editor element is assigned the role of application.

Roles and Attributes Functionalities
role="application" This attribute added to the editor element describes the actual role of the element.
aria-disabled Indicates the disabled state of the editor.
@using Syncfusion.Blazor.RichTextEditor

<SfRichTextEditor ShowCharCount="true">
    <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 accessibility

Keyboard support

The editor has complete keyboard access, including shortcuts to open and other actions with toolbar items, drop-down lists, and dialogs. 

HTML editor shortcuts

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 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 editor shortcuts

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 configuration

Customize the key configuration for the keyboard interaction of the 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 knows how to render and configure the rich text editor tools.

See also