WYSIWYG editing Image gallery upload Content templates
API documentation

Class Reference

Complete Tag Helper property reference, service configuration options, and editor command documentation for the RichTextBox ASP.NET Core package.

Tag Helper

<richtextbox> Attributes

All attributes available on the <richtextbox> tag helper element.

Core

AttributeTypeDefaultDescription
idstringautoHTML element ID for the editor instance
namestringrequiredForm field name for the HTML content
asp-forexpression-Model expression for two-way binding
htmlstringemptyInitial HTML content for the editor
classstring-CSS class for the editor wrapper element

Toolbar

AttributeTypeDefaultDescription
toolbarstring"default"Toolbar preset: default, full, basic, ribbon, office, or a custom button string
toolbar-mobilestring"mobile"Toolbar layout for mobile-width screens

Appearance

AttributeTypeDefaultDescription
skinstring"default"Visual skin: default, gray, office2007blue, rounded-corner, blue
widthstring"100%"Editor width (CSS value: px, %, em)
heightstring"300px"Editor height (CSS value)
resize-modestring"both"Resize mode: both, height, none

Content Behavior

AttributeTypeDefaultDescription
paste-modestring"Auto"Paste handling: Auto, Text, Word, Disabled
enter-key-tagstring"p"Tag for Enter key: p, div, br
url-typestring"default"URL processing: default, relative, absolute
read-onlyboolfalseMakes the editor read-only

Context Menu

AttributeTypeDefaultDescription
enable-context-menuboolfalseEnable custom right-click context menu
context-menu-modestring"Default"Menu preset: Default, Simple, Minimal

Statistics & UI

AttributeTypeDefaultDescription
show-tag-listbooltrueShow tag path in the bottom bar
show-statisticsbooltrueShow character/word statistics in the bottom bar

Content Styling

AttributeTypeDefaultDescription
content-css-urlstringbuilt-inURL of a CSS file applied to the content area
content-css-textstring""Inline CSS text applied to the content area
preview-css-urlstringbuilt-inCSS file for the preview window
editor-body-css-classstring""CSS class applied to the editor body element
editor-body-css-textstring""Inline CSS for the editor body element

Dialog Data

AttributeTypeDefaultDescription
image-items-jsonstring[]JSON array of image URLs for the insert image dialog
gallery-images-jsonstring[]JSON array of {url, text} objects for the gallery
html-templates-jsonstring[]JSON array of [name, html] arrays for templates

Autosave

AttributeTypeDefaultDescription
auto-saveboolfalseEnable localStorage draft saving
auto-save-keystringautolocalStorage key for draft isolation
auto-save-delayint600Delay in milliseconds between saves

Validation

AttributeTypeDefaultDescription
max-html-lengthint0 (unlimited)Maximum total HTML characters
max-text-lengthint0 (unlimited)Maximum visible text characters

Services

AddRichTextBox() Options

Configure the RichTextBox services in Program.cs.

PropertyTypeDefaultDescription
UploadWebPathstring"/uploads"Web-accessible path for uploaded files
MaxUploadByteslong4194304Maximum upload file size (4 MB default)
AllowedImageExtensionsstring[].jpg .png .gif .webp .svgAllowed image file extensions
AllowedFileExtensionsstring[].zip .pdf .doc .docx .rtf .txtAllowed non-image file extensions
RequireValidLicensebooltrueRequire valid license file
LicenseNumberstring"30076785"Expected license number

JavaScript

execCommand Reference

Commands available via editor.execCommand(commandName).

Formatting

bold, italic, underline, strike, superscript, subscript, removeformat, formatpainter, changecase

Font & Color

fontname, fontsize, forecolor, backcolor, lineheight, paragraphs, inlinestyle

Alignment

justifyleft, justifycenter, justifyright, justifyfull, ltr, rtl

Lists & Structure

insertorderedlist, insertunorderedlist, indent, outdent, insertblockquote, inserthorizontalrule, inserttable

Links & Media

insertlink, unlink, insertimage, insertgallery, insertvideo, insertdocument, insertanchor, insertimagemap

Insert

insertemoji, insertchars, insertcode, inserttemplate, insertdate, insertbox, insertlayer, insertfieldset

Clipboard

cut, copy, paste, pastetext, pasteword, delete, selectall

View & Tools

code, preview, find, print, fullscreenenter, fullscreenexit, toggleborder, togglemore, help

History

undo, redo, newdoc, save, load, cleancode

Endpoints

MapRichTextBoxUploads()

Maps the following endpoints in your ASP.NET Core application:

EndpointMethodDescription
/richtextbox/uploadPOSTUpload images and files
/richtextbox/galleryGET/POSTBrowse folders, list images, create folders