Skip to content

Extras

RichTextEditor

Bit.BlazorUI.ExtrasWysiwygEditorHtmlEditor

A native WYSIWYG editor whose HTML you two-way bind with Value. Its toolbar is a flags enum of groups you can reorder and extend; every byte in and out passes an allowlist sanitizer; and markdown typing rules, a slash menu, mentions, keyboard chords, counting, localization and EditForm validation are built in. The toolbar, panels and menus follow the keyboard and ARIA patterns of their roles, and Alt+0 lists every shortcut.

Forms, events & API

EditForm validation and counting, focus and selection events, localized strings, and driving the editor from code.

Forms & validation

In an EditForm, @bind-Value ties the editor to its field: a failing field gets the error border and aria-invalid. Label names the editor (click it to focus), Required marks it, Description adds helper text, and ShowCount with MaxLength adds a counter that caps typing, pasting and dropping alike; the surface is described by all of them. Outside a form, ErrorMessage (or Invalid alone) reports a rejection of your own, announced as it appears.

ShowValidationMessage shows the messages of the form under the editor, where ErrorMessage goes, so the form below needs no ValidationMessage component. The surface is described by them through aria-describedby, ahead of the helper text and the counter, so they are read out when it takes the focus, and an ErrorMessage of the app's own wins the place while it is set. They are not announced as they appear: a submit validates every field at once, and a message from each of them read out in a row would bury the form under its own errors. A BitParams holding a BitRichTextEditorParams with ShowValidationMessage turns it on for every editor inside it.

Description
Plain words work best: what changed and why.
0 words · 0/500 chars
Press Alt+0 for keyboard shortcuts.



Comment

Save this to see the server reject it, then edit it to clear the error.

Press Alt+0 for keyboard shortcuts.

Events

OnFocus and OnBlur follow the text surface; OnSelectionChange reports the state the toolbar highlights from (styles, block, colors, link, table, image), to build your own chrome on.

A heading

Some bold text with a link in it.

Press Alt+0 for keyboard shortcuts.

Editor is blurred; the caret is in: nothing yet

Localization

An IBitRichTextEditorLocalizer translates every label, tooltip, panel, menu and message by a stable key; returning null keeps the English text, so a partial dictionary is enough.

Pase el cursor sobre los botones para ver las descripciones traducidas.

Press Alt+0 for keyboard shortcuts.

Imperative API

Through @ref: focus, run commands, insert text or (sanitized) HTML, set or clear the content, undo/redo, select all, and read back the HTML, text or selection. CharacterCount, WordCount and IsEmpty are kept current without a browser round trip.


Drive me from the buttons above.

Press Alt+0 for keyboard shortcuts.

Result:

Feedback

Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.