Search...

Search documentation...

Rich Text Editor

Rich Text Editor

A Tiptap-based editor with a fixed toolbar — bold/italic/strikethrough, headings, lists, blockquote, undo/redo. Stores and emits plain HTML via value/onChange, so it drops straight into a Form field. RichTextViewer renders that same HTML read-only, with matching typography.

import { RichTextEditor, RichTextViewer } from "@pompeitech/vesuvius-ui";

Editor

Viewer (read-only)

Rendered read-only, matching typography.

API

RichTextEditor

PropTypeDefaultDescription
valuestringThe editor's content as an HTML string.
onChange(html: string) => voidFires with the new HTML on every edit.
placeholderstringShown in the empty editor.
editablebooleantrueSet false to lock editing while keeping the toolbar mounted (rare — prefer RichTextViewer for a genuinely read-only display).

Plus every native <div> prop on the root wrapper.

RichTextViewer

PropTypeDescription
htmlstringRequired — the HTML to render read-only.
classNamestring

Accessibility

The toolbar's buttons carry accessible labels and reflect the active formatting state (aria-pressed) for the current selection, same as Toggle. Since the stored value is raw HTML, sanitize or trust its source appropriately before rendering it elsewhere (e.g. with RichTextViewer) — this component doesn't sanitize on your behalf.