RichTextEditor
Since 0.1.0-alpha.22IzzyBlazor.RichTextEditor in the IzzyBlazor.Core package, generated from the 0.1.0-alpha.31 assembly
and its doc comments.
Properties (21)
ToolsRichTextTools = RichTextTools.DefaultThe tools in the toolbar. Defaults to RichTextTools.Default, every tool; RichTextTools.None leaves only the shortcuts.
Rowsint = 6The height of the text, in lines, before it grows. Defaults to 6.
Placeholderstring?Example text shown when empty.
ReadOnlybool = falseMakes the field read-only: the text can be selected, not changed, and it still posts.
ContentClassstring?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.MdThe 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 = trueTurns 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 = 1The 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>?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>?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)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?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 = falseImages 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 = falseThe 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 = 2000000The largest image, in bytes, that can be uploaded or embedded. Defaults to 2 MB.
WrapToolbarbool = trueThe 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?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 = falseShows "n / max" under the field. Needs MaxLength. Updates as you type once scripts run.
ToolbarContentRenderFragment?Tools of your own at the end of the toolbar, such as a ToolbarButton whose OnClick calls InsertHtmlAsync.
@bind-Valuestring?The value, bound with @bind-Value.
DisplayNamestring?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)
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
enumText size for Prose.
| Value | Description |
|---|---|
Sm | 14px text, for asides and dense pages. |
Md | 16px text (the default). |
Lg | 18px text, for long reading. |
RichTextTools
enumThe tools in a RichTextEditor's toolbar. Combine single tools with |, or start from RichTextTools.Basic or RichTextTools.Default.
| Value | Description |
|---|---|
None | No toolbar: shortcuts only. |
TextStyle | A list of text styles: normal text and five heading levels from the editor's |
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 |
Font | A font from the editor's |
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 |
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 |