Skip to content

Extras

RichTextEditor

Bit.BlazorUI.Extras

A native WYSIWYG editor whose HTML you two-way bind with the Value parameter. The toolbar is a flags enum you compose group by group - history, block formats, fonts and colors, inline styles, lists and checklists, links, images, tables, media, alignment and direction, emoji, find & replace, source view and full screen - and it can be reordered or extended with your own buttons. Every byte in and out passes an allowlist sanitizer, and markdown typing rules, a slash menu, mentions, keyboard chords, counting with a limit, localization and EditForm validation are built in.

Notes

To use this component, you need to install the Bit.BlazorUI.Extras(opens in a new tab) nuget package, as described in the Optional steps of the Getting started page.

The content produced by the editor is untrusted input. The component sanitizes every path in and out of the editor against an allowlist, but that pass runs in the browser and a browser is not a trust boundary: always sanitize the emitted HTML on the server before storing or redisplaying it.

Usage

Every example is live. Open its code to see exactly what produced the component running underneath.

Basic

The simplest usage: a single tag gives you a fully functional editor - the default toolbar, a contenteditable surface, undo/redo, and the built-in keyboard shortcuts.

Placeholder, size & focus

Placeholder is shown while the editor is empty, and is announced as the field's placeholder rather than only drawn. Height sets the minimum height of the editing surface and MaxHeight caps it, so long content scrolls inside the editor instead of growing the page; both accept any CSS length (300px, 20rem, or auto to fit the content). Resizable adds a drag handle on the bottom edge so the reader can pick the height themselves. AutoFocus puts the caret in the editor on load, and SpellCheck (on by default) toggles the browser's own spell checking.

Readonly & disabled

Set ReadOnly to lock editing while keeping the content selectable and copyable - handy for displaying stored content. A read-only editor keeps a tab stop, so its text can still be reached, scrolled and read out from the keyboard. Combine it with ShowToolbar set to false to hide the toolbar entirely and Height set to auto to fit the content. IsEnabled set to false goes further: the editor is dimmed, drops out of the tab order, stops responding to the pointer, and refuses every edit path - typing, pasting, dropping and shortcuts alike.


Two-way binding

The content is a plain string you own. @bind-Value keeps it in sync both ways: edits flow out to your field, and programmatic changes (the buttons below) flow back into the editor without disturbing an in-progress caret when the value is unchanged. What flows out is always the sanitized markup, so the bound string can never hold something the editor refused to render - and an editor the user has emptied reports an empty string, not the <br> the browser leaves behind, so a required check or a dirty comparison reads it the way it looks.



Bound value:
<p>The bound value is just a <strong>string</strong> you own.</p>

Debounce

While typing, change notifications are debounced. Tune the window with DebounceMs (default 200). A larger value raises fewer change events; a smaller value updates the bound value more eagerly. Leaving the editor always flushes the pending notification, so a blur never loses the last keystrokes.


<p>Type and watch the value update after the debounce window.</p>

Focus & blur events

OnFocus and OnBlur fire when the editing surface gains or loses keyboard focus.


Editor is currently: blurred

Formatting

The default toolbar covers the everyday essentials: bold, italic, underline, strikethrough and inline code; paragraph, H1-H6, quote and code block; bullet, numbered and task lists; alignment including justify; undo/redo; and clear formatting. Toolbar buttons light up to reflect the formatting at the cursor, and checklist items are toggled by clicking their box.

Indentation & scripts

The extended Indent and Script groups add increase/decrease indent and subscript/superscript. Inside a list, Tab and Shift+Tab indent and outdent too - outside one they keep their normal meaning, so the editor never traps the keyboard.

Toolbar groups

The Toolbar parameter is a Flags enum. Combine groups with bitwise OR to show only what you need - here just the inline and lists groups.

Full toolbar

Use the AllExtended preset to enable every available group, including images, tables, color, fonts, media, direction, source view, find, full screen and more.

Links

Enable the Link group to insert, edit, and remove hyperlinks (Ctrl/Cmd+K opens the panel). With nothing selected you can supply the link text; "New tab" adds target="_blank" together with rel="noopener noreferrer", and opening the panel on an existing link fills in both its URL and whether it opens in a new tab, so editing one never quietly changes the other. A bare host such as example.com is completed to https, and invalid or disallowed URLs raise OnError with a stable code such as invalid-url while the content is left unchanged. Pasting a URL works the way it does everywhere else: dropped onto selected text it links that text, and pasted on its own it arrives as a link.

Images

Insert images by URL - with alternative text for screen readers - or by drag-and-drop and clipboard paste. Provide an OnImageUpload callback to persist the bytes and return a hosted URL, or return null to cancel. Without the callback, images are embedded as inline data URLs. Files are checked for type and size (10 MB) on both sides of the bridge. Click an image to select it: it can then be resized by dragging its handle - with a mouse, a pen or a finger - and floated left, centered, or floated right from the toolbar (clicking the active alignment again puts it back inline). Reopening the image panel while an image is selected edits that image instead of adding one, so its source and its alternative text can be corrected after the fact rather than only at the moment it was inserted.

Colors

The Color group adds foreground (text) and background (highlight) color pickers. Each picker shows the color already applied at the cursor, because the active colors are reported back in the selection state. Beside each one is a button that takes that color back off the selection, so removing a color does not mean clearing every other style with it.

Fonts

The Font group adds family and size selectors that reflect what is applied at the cursor. Provide your own options with FontFamilies and FontSizes, or leave them empty to use the built-in defaults.

Tables

The Table group inserts a table of the size you pick, optionally with a header row. Once the cursor is inside one, the structural buttons come alive: insert a row above or below, a column before or after, delete a row, a column or the whole table, toggle the header row, and merge or split cells - all of which keep existing merges intact. Tab and Shift+Tab walk from cell to cell, and a Tab in the last cell appends a row, so a table can be filled in without leaving the keyboard. Column widths are adjusted by dragging a cell border.

Media & rules

The Media group embeds a YouTube or Vimeo link as a privacy-friendly iframe and a direct audio/video URL as a native audio/video element. Embeds are the one place the sanitizer restricts by host as well as by tag: an iframe survives only when its source is an https URL on an approved embed host, so pasted or stored markup cannot smuggle an arbitrary frame in. Every policy is held to that rule - widen it deliberately with AllowedIframeHosts rather than by listing the tag. The Rule group inserts a horizontal divider.

Source view

The Source group toggles a raw HTML editor. While it is open the formatting controls are disabled so the two views cannot diverge, and on exit the HTML is validated - unbalanced or misnested markup is refused with an error, while a < that is plainly text ("5 < 10") is left alone - and run through the active sanitization policy before returning to the WYSIWYG surface.

Sanitization

Sanitization is allowlist-based: only the listed tags, attributes, and URI schemes are kept and everything else is stripped on paste, drag-drop, source-view exit, and programmatic changes. A surviving style attribute is filtered further, down to presentational CSS properties, and an iframe is held to the embed hosts of AllowedIframeHosts whatever the tag list says. Tightening the policy at runtime also re-cleans the content already loaded. The browser pass is a first line of defense only - always sanitize the emitted HTML on the server too.

Plain-text paste

Set PasteAsPlainText to strip all formatting from pasted content and insert it as plain text. Left off, pasted markup is normalized first - the wrappers Word and Google Docs add are removed - and then sanitized, and a single paste can still be stripped on demand with Ctrl/Cmd+Shift+V. Whichever way the content arrives, it is budgeted against MaxLength before it lands.

Find & replace

The Find group adds a search panel that highlights every match and marks the current one. Step through the hits with the arrows or Enter and Shift+Enter, narrow the search with the match-case and whole-word toggles, and replace either the current match or all of them. The readout says which match you are on, and Escape closes the panel.

Full screen

The FullScreen group adds a toggle that expands the editor to fill the viewport for distraction-free writing, and collapses it back. Leaving full screen from outside the component - the Escape key or the browser's own chrome - keeps the toggle in sync. Where the browser's Fullscreen API is unavailable or refused (an embedded frame, for instance) the editor fills the viewport by itself instead, and Escape still leaves.

Typing shortcuts & slash menu

Markdown-style prefixes are converted as you type: # through ###### for headings, > for a quote, -, * or + for a bulleted list, 1. for a numbered one, [] or [x] for a task, ``` for a code block, and --- for a divider. Inline markdown closes on its own delimiter: **bold** or __bold__, *italic* or _italic_, ~~strikethrough~~ and `code`. None of these rules - nor autolinking, nor the slash and mention triggers - fire inside a code block or a code span, where those characters are the content being written. Enter on the empty last line of a quote or a code block leaves it for a fresh paragraph, so a block entered by typing can be left by typing. A typed or pasted URL becomes a link as soon as the word is finished (turn that off with AutoLink). Typing / on an empty line opens a command menu you can filter by name or keyword and drive entirely from the keyboard.

Keyboard shortcuts

Common chords work out of the box: Ctrl/Cmd+B, I and U for bold, italic and underline, Shift+X for strikethrough, Ctrl/Cmd+E for inline code, Ctrl/Cmd+K for a link, Shift+7/8/9 for numbered, bulleted and task lists, Ctrl/Cmd+Z and Y for history, Ctrl/Cmd+Shift+V to paste without formatting, and Alt+F10 to move focus into the toolbar (Escape returns it to the text). Whichever chord ends up bound to a command is what the matching toolbar button announces to a screen reader. Override or extend them with KeyboardShortcuts - a map of chords to command names. Use "ctrl" for the primary modifier on all platforms.

The command strings that can be mapped in KeyboardShortcuts are:
  • Inline: bold, italic, underline, strikeThrough, inlineCode
  • History: undo, redo
  • Lists: insertOrderedList, insertUnorderedList, insertTaskList
  • Alignment: justifyLeft, justifyCenter, justifyRight, justifyFull
  • Indentation: indent, outdent
  • Script: subscript, superscript
  • Other: removeFormat, link, unlink, insertHorizontalRule
  • Paragraph formats: p, h1-h6, blockquote, pre - these toggle, so the chord that applies a format also takes it back off

Emoji & symbols

The Emoji group adds a searchable picker, grouped into smileys, gestures, nature, objects and symbols - the last of which covers the typographic and mathematical characters that are awkward to type (arrows, dashes, currency, fractions, Greek letters). Search matches both the name and its everyday keywords.

Character & word count

Set ShowCount to display a count footer, announced to screen readers as it changes. Add MaxLength to cap the plain-text character count: typing, pasting, dropping, replacing and emoji insertion are all budgeted against it, so the limit holds however the content arrives.

0 words · 0/120 chars

EditForm validation

The editor participates in EditForm like any input. Bind a model property with @bind-Value and the component picks up the EditContext, so DataAnnotationsValidator and ValidationMessage work as expected.

0 words · 0/500 chars

Custom toolbar item

Add your own buttons with ToolbarConfig.CustomItems. Each item needs an Id and either an AriaLabel or a Label, plus an OnActivate callback that receives the editor instance - so it can call the imperative API. For display, supply a Label or an Icon. A callback that throws is reported through OnError instead of breaking the editor. The custom "Today" button appears at the end of the toolbar below.

Reordering toolbar groups

Set ToolbarConfig.Order to a list of entry ids - use BitRichTextEditorToolbarConfig.GroupIds rather than raw strings. Listed ids appear first in that order; any enabled-but-omitted groups are appended in their default order, and unknown ids are skipped.

Localization

Supply an IBitRichTextEditorLocalizer to translate every label, tooltip, panel caption, slash-menu entry and error message. The indexer receives a stable key and returns null to keep the built-in English text, so a partial dictionary is enough.

Imperative API

Capture the component with @ref to drive it from code: FocusAsync moves keyboard focus, ExecuteCommandAsync runs a raw editing command, InsertTextAsync and InsertHtmlAsync write at the caret (the HTML is sanitized first), SetHtmlAsync and ClearAsync replace the whole content, UndoAsync, RedoAsync and SelectAllAsync drive the selection and history, and GetHtmlAsync, GetTextAsync and GetSelectedTextAsync read it back. CharacterCount, WordCount and IsEmpty are plain properties kept current by the editor, so a submit button or a counter can read them without a round trip to the browser.



result:

Selection toolbar

Set ShowQuickToolbar to float a compact formatting bar next to the text as soon as something is selected, so the common actions are under the cursor instead of at the top of the editor. It tracks the selection as the surface scrolls, disappears when the selection collapses, and steps aside for the slash menu and the tool panels. It complements the main toolbar rather than replacing it - pair it with ShowToolbar set to false for a chrome-free writing surface, where the link panel still opens from the bar or from Ctrl/Cmd+K.

Mentions

Supply OnMentionSearch and typing @ at the start of a word opens a people picker: the callback receives what is typed into the menu and returns the matches, which are navigated with the arrow keys and picked with Enter. Only the newest lookup is applied, so a slow response cannot overwrite a later one. The inserted mention is a span carrying your own id in data-mention-id - part of the default allowlist, so it survives a save-and-reload round trip - and OnMentionSelected tells you which record was chosen.

Smart typography

Set SmartTypography and the everyday typing shorthands become the characters they stand for: straight quotes curl into “ ” and ‘ ’ as you type them (opening or closing, decided by what precedes them), -- becomes an em dash, ... an ellipsis, (c), (r) and (tm) their symbols, 1/2, 1/4 and 3/4 real fractions, and ->, <-, !=, <=, >= and +/- their arrows and math signs. Everything but the quotes is applied when the space finishes the word, so it is always one undo away, and nothing is rewritten inside code spans or code blocks. It is off by default: a document full of code or measurements wants exactly what was typed.

Selection events

OnSelectionChange reports the same snapshot the toolbar highlights itself from - the active inline styles, the block tag, colors and font at the caret, the link, image or table cell it sits in - every time the selection or the formatting under it changes. It is what a host builds its own chrome from: a custom toolbar outside the component, a status bar, or a panel that only appears inside a table.


Caret is in: nothing yet

Style & Class

Use the Styles parameter to apply custom inline styles to individual parts of the editor (root, toolbar, group, button, editor, source, and count). The Classes parameter works the same way for CSS classes.

RTL

Set Dir to BitDir.Rtl to lay the whole editor out right-to-left. The Direction toolbar group is independent of it: it sets the direction of the block at the cursor, so a single document can mix paragraphs of both directions.

API

Every parameter, public member, sub-class and enum this component exposes.

BitRichTextEditor parameters

Name Type Default value Description
AutoFocus bool false Automatically moves keyboard focus into the editor after the first render.
AutoLink bool true Turns a URL typed into the editor into a link as soon as the word is finished.
Classes BitRichTextEditorClassStyles? null Custom CSS classes for different parts of the rich text editor.
DebounceMs int 200 Debounce window (ms) for content-change notifications while typing. Negative values are treated as 0.
FontFamilies IReadOnlyList<string>? null Font families offered in the font-family selector. Null/empty uses defaults.
FontSizes IReadOnlyList<string>? null Font sizes offered in the font-size selector. Null/empty uses defaults.
Height string 300px Minimum height of the editing surface (any CSS length).
KeyboardShortcuts IReadOnlyDictionary<string, string>? null Custom key-combo to command map, merged over the built-in defaults.
Localizer IBitRichTextEditorLocalizer? null Localized labels/tooltips provider. Null uses built-in English labels.
MaxHeight string? null Maximum height of the editing surface (any CSS length). Content beyond it scrolls inside the editor.
MaxLength int? null Maximum plain-text character count. Null means unlimited.
OnBlur EventCallback Callback for when the editor loses focus.
OnChange EventCallback<string?> Callback for when the editor content changes.
OnError EventCallback<BitRichTextEditorError> Callback for when the editor encounters a recoverable error.
OnFocus EventCallback Callback for when the editor gains focus.
OnMentionSearch Func<string, Task<IReadOnlyList<BitRichTextEditorMention>>>? null Supplies the suggestions shown after the user types "@". Leaving it null disables mentions.
OnMentionSelected EventCallback<BitRichTextEditorMention> Callback for when a mention is picked from the menu.
OnImageUpload Func<BitRichTextEditorImageUpload, Task<string?>>? null Invoked to persist an image binary, returning the URL to embed. When null, dropped or pasted images are embedded as inline data URLs.
OnSelectionChange EventCallback<BitRichTextEditorSelectionState> Callback for when the selection - or the formatting under it - changes; receives the same snapshot the toolbar highlights itself from.
PasteAsPlainText bool false When true, pasted content is inserted as plain text.
Placeholder string? null The placeholder value of the editor shown while it is empty.
ReadOnly bool false Makes the editor readonly.
Resizable bool false Lets the reader drag the bottom edge of the editing surface to make it taller or shorter.
SanitizationPolicy BitRichTextEditorSanitizationPolicy? null Allowlist policy applied to all content. When null a secure default allowlist is applied.
ShowCount bool false Show the character/word count footer.
ShowQuickToolbar bool false Whether a small formatting toolbar floats next to the current text selection.
ShowToolbar bool true Whether the formatting toolbar is shown.
SmartTypography bool false Replaces common text patterns with their typographic characters as they are typed: curly quotes, em dash, ellipsis, copyright/registered/trademark signs, fractions, arrows and comparison symbols.
SpellCheck bool true Whether the browser's native spell checking runs over the editor content.
Styles BitRichTextEditorClassStyles? null Custom CSS styles for different parts of the rich text editor.
Toolbar BitRichTextEditorToolbar BitRichTextEditorToolbar.All Which toolbar groups to display.
ToolbarConfig BitRichTextEditorToolbarConfig? null Custom toolbar items and ordering. Null uses the default group order.
Value string? null The two-way bound HTML content of the editor.

BitRichTextEditor public members

Name Type Default value Description
CharacterCount int The plain-text character count of the current content, as the count footer and MaxLength count it.
ClearAsync Task Clears the editor content.
ExecuteCommandAsync Task Runs a raw editing command against the editor.
FocusAsync ValueTask Moves keyboard focus into the editor.
GetHtmlAsync ValueTask<string> Returns the current HTML content of the editor.
GetSelectedTextAsync ValueTask<string> Returns the plain text of the current selection, or an empty string when nothing inside the editor is selected.
GetTextAsync ValueTask<string> Returns the current content of the editor as plain text, with block boundaries rendered as newlines and all markup removed.
InsertHtmlAsync Task Inserts HTML at the current caret position, after running it through the active sanitization policy.
InsertTextAsync Task Inserts plain text at the current caret position, honoring MaxLength.
IsEmpty bool Whether the editor holds nothing a reader would see - no text and none of the elements that are content without carrying text (images, tables, rules, media).
RedoAsync Task Redoes the last undone edit.
SelectAllAsync ValueTask Selects the whole editor content.
SetHtmlAsync Task Replaces the whole content with the given HTML (sanitized), or clears it when null/empty.
UndoAsync Task Undoes the last edit.
WordCount int The word count of the current content.

BitComponentBase parameters

Name Type Default value Description
AriaLabel string? null Gets or sets the accessible label for the component, used by assistive technologies.
Class string? null Gets or sets the CSS class name(s) to apply to the rendered element.
Dir BitDir? null Gets or sets the text directionality for the component's content.
ForceAnimation bool false Gets or sets a value indicating whether the component's animations play at their full duration even when reduced motion is requested.
HtmlAttributes Dictionary<string, object> new Dictionary<string, object>() Captures additional HTML attributes to be applied to the rendered element, in addition to the component's parameters.
Id string? null Gets or sets the unique identifier for the component's root element.
IsEnabled bool true Gets or sets a value indicating whether the component is enabled and can respond to user interaction.
Style string? null Gets or sets the CSS style string to apply to the rendered element.
TabIndex string? null Gets or sets the tab order index for the component when navigating with the keyboard.
Visibility BitVisibility BitVisibility.Visible Gets or sets the visibility state (visible, hidden, or collapsed) of the component.

BitComponentBase public members

Name Type Default value Description
UniqueId Guid Guid.NewGuid() Gets the readonly unique identifier for the component's root element, assigned when the component instance is constructed.
RootElement ElementReference Gets the reference to the root HTML element associated with this component.

BitRichTextEditorClassStyles properties

Name Type Default value Description
Root string? null Custom CSS classes/styles for the root of the BitRichTextEditor.
Toolbar string? null Custom CSS classes/styles for the toolbar of the BitRichTextEditor.
Group string? null Custom CSS classes/styles for the toolbar groups of the BitRichTextEditor.
Button string? null Custom CSS classes/styles for the toolbar buttons of the BitRichTextEditor.
Editor string? null Custom CSS classes/styles for the editor (content) area of the BitRichTextEditor.
Source string? null Custom CSS classes/styles for the HTML source view textarea of the BitRichTextEditor.
Count string? null Custom CSS classes/styles for the character/word count footer of the BitRichTextEditor.

BitRichTextEditorToolbarConfig properties

Configures toolbar ordering and custom items.

Name Type Default value Description
Order IReadOnlyList<string>? null Explicit ordering of toolbar entry ids (built-in group ids and custom item ids). Use BitRichTextEditorToolbarConfig.GroupIds for the built-in ids.
CustomItems IReadOnlyList<BitRichTextEditorToolbarItem>? null Custom toolbar items (max 50 are rendered).

BitRichTextEditorToolbarItem properties

A custom toolbar button supplied by the host.

Name Type Default value Description
Id string Unique id used for ordering and lookup. It must not collide with a built-in group id.
Label string? null Text label shown when no icon is provided.
Icon RenderFragment? null Optional icon content.
AriaLabel string? null Optional accessible label / tooltip. When omitted, Label is used as the accessible name.
OnActivate Func<BitRichTextEditor, Task> Action invoked when the item is activated; receives the editor instance.

BitRichTextEditorSanitizationPolicy properties

An allowlist sanitization policy. Only the listed tags, attributes, and URI schemes are retained; everything else is removed. The static Default property returns a fresh copy of the built-in policy.

Name Type Default value Description
AllowedTags ISet<string> Permitted (lowercase) element/tag names.
AllowedAttributes IDictionary<string, ISet<string>> Permitted attributes per tag name. Use the key "*" for attributes allowed on any tag. A permitted style attribute is filtered further, down to presentational CSS properties.
AllowedUriSchemes ISet<string> Permitted URI schemes for href/src attributes (e.g. http, https, mailto).
AllowDataImageUris bool true Whether data: image URIs are permitted in image sources.
AllowedIframeHosts IReadOnlyCollection<string>? null Hosts an iframe may point at, over https. Null applies the built-in approved embed hosts (YouTube, YouTube-nocookie, Vimeo); an empty collection permits no iframe at all; a single "*" entry lifts the restriction and lets any https source through.

BitRichTextEditorImageUpload properties

An image to be persisted by the host's OnImageUpload delegate.

Name Type Default value Description
FileName string Original file name, when available.
ContentType string MIME type, e.g. "image/png".
Content byte[] Raw image bytes.

BitRichTextEditorSelectionState properties

Snapshot of the formatting under the selection, reported to OnSelectionChange and used to highlight the toolbar.

Name Type Default value Description
Bold bool false Whether the selection is bold.
Italic bool false Whether the selection is italic.
Underline bool false Whether the selection is underlined.
StrikeThrough bool false Whether the selection is struck through.
InlineCode bool false Whether the selection sits inside an inline code span (not a code block).
Subscript bool false Whether the selection is subscript.
Superscript bool false Whether the selection is superscript.
OrderedList bool false Whether the selection sits in a numbered list.
UnorderedList bool false Whether the selection sits in a bulleted list.
TaskList bool false Whether the selection sits in a checklist item.
JustifyLeft bool false Whether the block is aligned left.
JustifyCenter bool false Whether the block is centered.
JustifyRight bool false Whether the block is aligned right.
JustifyFull bool false Whether the block is justified.
Block string "" The current block tag ("p", "h1", "blockquote", "pre", ...), lowercase.
Direction string? null Text direction of the selected block ("ltr"/"rtl"), or null.
ForeColor string? null Active text color of the selection, or null when mixed/none.
BackColor string? null Active highlight color of the selection, or null when mixed/none.
FontName string? null Active font family, or null when the selection spans several.
FontSize string? null Active font size as a CSS length, or null when the selection spans several.
InLink bool false Whether the selection sits inside a hyperlink.
LinkHref string? null The href of the link under the selection, or null when none/multiple.
LinkNewTab bool false Whether that link opens in a new tab (target="_blank").
InTable bool false Whether the selection sits inside a table cell, which is what enables the table operations.
ImageSelected bool false Whether an image inside the editor is selected.
ImageAlign string? null Alignment of the selected image ("left", "center", "right"), or null when it flows inline.
ImageSrc string? null Source of the selected image, or null when no image is selected.
ImageAlt string? null Alternative text of the selected image (empty when it has none), or null when no image is selected.
HasSelection bool false Whether a non-empty range inside the editor is selected.
SelectionTop double 0 Top of the selection rectangle, in pixels relative to the component root.
SelectionLeft double 0 Left edge of the selection rectangle, in pixels relative to the component root.
SelectionWidth double 0 Width of the selection rectangle in pixels.
SelectionHeight double 0 Height of the selection rectangle in pixels.

BitRichTextEditorMention properties

A single suggestion offered by the mention menu.

Name Type Default value Description
Id string Stable identifier written into the inserted markup as data-mention-id.
Display string The text shown in the menu and inserted after the trigger character.
Description string? null Optional secondary line shown under the display text in the menu.

BitRichTextEditorError properties

An error surfaced by the editor (e.g. invalid URL, failed upload, invalid HTML).

Name Type Default value Description
Code string Stable error code, e.g. "invalid-url".
Message string Human-readable description.

IBitRichTextEditorLocalizer properties

Provides localized labels and tooltips for the editor's controls.

Name Type Default value Description
this[string key] string? Returns the localized string for the given key, or null to use the built-in English default.

BitRichTextEditorToolbar enum

Name Value Description
None 0
History 1
BlockFormat 2
Inline 4
Lists 8
Blocks 16
Link 32
Alignment 64
Clear 128
Image 256
Color 512
Font 1024
Indent 2048
Script 4096
Source 8192
Table 16384
Media 32768
Rule 65536
Emoji 131072
Find 262144
FullScreen 524288
Direction 1048576
All 255
AllExtended 2097151

BitVisibility enum

Name Value Description
Visible 0 The content of the component is visible.
Hidden 1 The content of the component is hidden, but the space it takes on the page remains (visibility:hidden).
Collapsed 2 The component is hidden (display:none).

BitDir enum

Name Value Description
Ltr 0 Ltr (left to right) is to be used for languages that are written from the left to the right (like English).
Rtl 1 Rtl (right to left) is to be used for languages that are written from the right to the left (like Arabic).
Auto 2 Auto lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whole element.

Feedback

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