Skip to content
IzzyBlazor

Enter all results ↑ ↓ move Esc close

RichTextEditor

Since 0.1.0-alpha.22
Lets the user write formatted text, saved as sanitized HTML.

IzzyBlazor.RichTextEditor in the IzzyBlazor.Core package, generated from the 0.1.0-alpha.31 assembly and its doc comments.

Properties (21)

ToolsRichTextTools = RichTextTools.DefaultAdded in 0.1.0-alpha.22

The tools in the toolbar. Defaults to RichTextTools.Default, every tool; RichTextTools.None leaves only the shortcuts.

Rowsint = 6Added in 0.1.0-alpha.22

The height of the text, in lines, before it grows. Defaults to 6.

Placeholderstring?Added in 0.1.0-alpha.22

Example text shown when empty.

ReadOnlybool = falseAdded in 0.1.0-alpha.22

Makes the field read-only: the text can be selected, not changed, and it still posts.

ContentClassstring?Added in 0.1.0-alpha.22

A class on the text, for your own rules on what's in it, such as .article h2. Give the same class to RichText to show it the same way.

FontSizeProseSize = ProseSize.MdAdded in 0.1.0-alpha.22

The text's font size, on Prose's scale: 14, 16 or 18px, with the gaps between paragraphs to match. Defaults to ProseSize.Md. The width follows the editor's container.

MarkdownShortcutsbool = trueAdded in 0.1.0-alpha.22

Turns typed Markdown into formats as you type: ## a heading, - and 1. lists, > a quote, three backticks a code block, **bold**, *italic* and `code`. On by default; Ctrl+Z undoes a change it made.

TopHeadingint = 1Added in 0.1.0-alpha.22

The highest heading level, 1 to 6. The text-style menu offers it and the four below it. Defaults to 1; set 2 when the page shows its own heading 1 above the text, and give RichText the same.

FontsIReadOnlyList<string>?Added in 0.1.0-alpha.22

The fonts the Font tool offers, each a CSS font-family value such as Georgia, serif; the first name in each is its label. Only these are kept in the value. Give RichText the same list.

FontSizesIReadOnlyList<string>?Added in 0.1.0-alpha.22

Fixed text sizes for the Size tool, such as 12px or 14pt, in place of its steps (Smaller to Largest), which scale with the text around them. Only these are kept in the value. Give RichText the same list.

CodeLanguagesIReadOnlyList<string>? (computed)Added in 0.1.0-alpha.22

The languages a code block can be marked as, each a name such as csharp, written in the value as the code's class (language-csharp), which RichText highlights and Prism or highlight.js read too. Defaults to the languages the library's highlighter knows; an empty list leaves code blocks unmarked.

ImageUploadUrlstring?Added in 0.1.0-alpha.22

Where the image tool sends a chosen, pasted or dropped image: an endpoint of your app that takes a multipart POST with the image in a file field (and the form's antiforgery token, when it has one: a .NET 11 app without UseAntiforgery checks the origin instead), stores it, and answers with its URL, as text or as JSON { "url": "…" }. Without it, images come only by their address, or embedded with AllowDataImages.

AllowDataImagesbool = falseAdded in 0.1.0-alpha.22

Images chosen, pasted or dropped with no ImageUploadUrl are embedded in the value as data: URLs (PNG, JPEG, GIF, WebP or AVIF, never SVG). Off by default: it makes the value as large as its images. Give RichText the same.

CustomColorsbool = falseAdded in 0.1.0-alpha.22

The text color and highlight menus end with "Custom…", which opens a color panel for any color, written as a style with six hex digits. Off by default: a color chosen in a light theme can be unreadable in a dark one, which the palette's colors avoid. Give RichText the same.

MaxImageSizelong = 2000000Added in 0.1.0-alpha.22

The largest image, in bytes, that can be uploaded or embedded. Defaults to 2 MB.

WrapToolbarbool = trueAdded in 0.1.0-alpha.22

The toolbar wraps onto more rows (the default), filling each; false keeps it one row, and what doesn't fit moves into a "…" menu at its end.

MaxLengthint?Added in 0.1.0-alpha.22

The most characters of text, not counting the HTML around it. Checked on the server; with script, the count shows when it's passed.

ShowCountbool = falseAdded in 0.1.0-alpha.22

Shows "n / max" under the field. Needs MaxLength. Updates as you type once scripts run.

ToolbarContentRenderFragment?Added in 0.1.0-alpha.22

Tools of your own at the end of the toolbar, such as a ToolbarButton whose OnClick calls InsertHtmlAsync.

@bind-Valuestring?Added in 0.1.0-alpha.22

The value, bound with @bind-Value.

DisplayNamestring?Added in 0.1.0-alpha.22

The field's name in validation messages from the input itself, such as a value that can't be parsed.

Events (0)

No events.

Methods (1)

InsertHtmlAsyncAdded in 0.1.0-alpha.22
Task InsertHtmlAsync(string html)

Inserts HTML at the caret, or in place of the selection, as if typed: it's sanitized first, and Ctrl+Z undoes it. For your own tools on interactive pages; on a static page it does nothing.

Types (2)

ProseSize

enum

Text size for Prose.

ProseSize values
ValueDescription
Sm

14px text, for asides and dense pages.

Md

16px text (the default).

Lg

18px text, for long reading.

RichTextTools

enum

The tools in a RichTextEditor's toolbar. Combine single tools with |, or start from RichTextTools.Basic or RichTextTools.Default.

RichTextTools values
ValueDescription
None

No toolbar: shortcuts only.

TextStyle

A list of text styles: normal text and five heading levels from the editor's TopHeading.

Bold

Bold (Ctrl+B).

Italic

Italic (Ctrl+I).

Underline

Underline (Ctrl+U).

Strikethrough

Strikethrough (Ctrl+Shift+X).

InlineCode

Inline code (Ctrl+E).

Link

Add, change or remove a link (Ctrl+K).

BulletedList

Bulleted list (Ctrl+Shift+8).

NumberedList

Numbered list (Ctrl+Shift+7).

Indent

Indent and outdent a list item (Ctrl+] and Ctrl+[).

HorizontalRule

A horizontal line between sections.

ClearFormatting

Removes bold, italic and the other text formats from the selection.

UndoRedo

Undo (Ctrl+Z) and redo (Ctrl+Y).

Alignment

Align a paragraph or heading to the start, center or end (Ctrl+Shift+L, E, R).

Subscript

Subscript, as in H₂O (Ctrl+=).

Superscript

Superscript, as in x² (Ctrl+Shift+=).

TextColor

Text color, from a palette of seven that read in light and dark themes.

Highlight

A highlight behind the text, from the same palette.

FontSize

Text size: six steps from Smaller to Largest that scale with the text around them, or the editor's FontSizes.

Font

A font from the editor's Fonts; shows only when it has some.

Quote

A quote: the paragraph, or the selected ones, set apart as quoted.

CodeBlock

A code block, in a monospaced font, its spaces and lines kept.

Image

An image, by its address or uploaded (the editor's ImageUploadUrl), with its description.

Table

Tables: insert one, add and delete rows and columns, a header row.

TaskList

A task list: list items with a checkbox, ticked with a click or Ctrl+Enter (Ctrl+Shift+9).

Basic

Bold, italic, links and the two lists: for short notes and comments.

Default

Every tool (the default).

Extended

Every tool in RichTextTools.Default, and alignment, subscript, superscript, text color, highlight, size and font: for pages people lay out, such as announcements and articles.

Connection lost

Rejoining the server…