Blazorise RichTextEdit: API Reference
Explore the API reference for the Blazorise RichTextEdit component, detailing available attributes and methods.
The RichTextEdit component in Blazorise is a rich text editor that provides a user-friendly interface for creating and editing formatted text content. It supports a variety of text formatting options such as bold, italic, underline, lists, links, and more. Additionally, the editor is extensible, allowing developers to enable and use advanced features like inserting tables, images, and even embedding custom HTML content.
API
Parameters
RichTextEdit
Parameter | Description | Type | Default |
---|---|---|---|
ConfigureQuillJsMethod |
[Optional] The javascript method to call to configure additional QuillJs modules and or add custom bindings. |
string | |
Editor |
[Optional] Gets or sets the content visible in the editor. |
RenderFragment | null |
PlaceHolder |
Place holder text visible in empty editor. |
string | |
ReadOnly |
Gets or sets a value indicating whether the editor is ReadOnly. |
bool | false |
SubmitOnEnter |
Call RichTextEdit.RichTextEdit.EnterPressed event when user presses the ENTER key. |
bool | false |
Theme |
The theme (Snow or Bubble) of the editor. Possible values: |
RichTextEditTheme | RichTextEditTheme.Snow |
Toolbar |
[Optional] Gets or sets the content of the toolbar. |
RenderFragment | null |
ToolbarPosition |
Toolbar placed on the top or bottom of the editor. Possible values: |
Placement | Top |
RichTextEditToolbarGroup
Parameter | Description | Type | Default |
---|---|---|---|
ChildContent |
Gets or sets the child content. |
RenderFragment | null |
RichTextEditToolbarButton
Parameter | Description | Type | Default |
---|---|---|---|
Action |
Gets or sets the toolbar action. |
RichTextEditAction? | null |
Value |
Gets or sets the value corresponding to the action. |
string |
RichTextEditToolbarSelect
Parameter | Description | Type | Default |
---|---|---|---|
Action |
Gets or sets the select action. |
RichTextEditAction? | null |
ChildContent |
Gets or sets the child content. |
RenderFragment | null |
Events
RichTextEdit
Event | Description | Type |
---|---|---|
ContentChanged |
Occurs when the content within the editor changes. |
EventCallback |
EditorBlur |
Occurs when the editor loses focus. |
EventCallback |
EditorFocus |
Occurs when the editor gains focus. |
EventCallback |
EnterPressed |
Occurs when the enter key is pressed within the editor. RemarksThis event is triggered only when RichTextEdit.RichTextEdit.SubmitOnEnter is enabled. |
EventCallback |
Methods
RichTextEdit
Method | Description | Return | Parameters |
---|---|---|---|
SetHtmlAsync |
Sets the editor content as HTML asynchronously.
RemarksImproper handling of HTML can lead to cross-site scripting (XSS). Ensure that the HTML content is properly sanitized before setting it in the editor. | ValueTask | string html |
GetHtmlAsync |
Gets the editor content as HTML asynchronously. | ValueTask<string> | |
SetDeltaAsync |
Sets the editor content as a Quill Delta JSON asynchronously.
RemarksThe Quill Delta format is a rich text format used by the Quill editor. See the official Quill.js documentation for more details. | ValueTask | string deltaJson |
GetDeltaAsync |
Gets the editor content as a Quill Delta JSON asynchronously. | ValueTask<string> | |
SetTextAsync |
Sets the editor content as plain text asynchronously. | ValueTask | string text |
GetTextAsync |
Gets the editor content as plain text asynchronously. | ValueTask<string> | |
ClearAsync |
Clears the editor content asynchronously. | ValueTask | |
OnContentChanged |
Javascript callback for when content changes. | Task | |
OnEnter |
Javascript callback for when enter is pressed. | Task | |
OnEditorFocus |
Javascript callback for when editor get focus. | Task | |
OnEditorBlur |
Javascript callback for when editor lost focus. | Task |