Rich Text Editor
TipTap rich text with a compact toolbar. Default writing direction is ltr; set dir and lang to match your content. On phones the toolbar docks above the keyboard; on desktop it stays sticky at the top.
Simple
Default variant="simple" — one toolbar row with history, heading, marks, lists, and insert.
Loading…
Installation
CLI
Also needs
npx @sonojs/ui@latest add button dialog dropdown-menu input label popover separator toggle-group tooltipnpm i @tiptap/extension-highlight@^3.34.0 @tiptap/extension-image@^3.34.0 @tiptap/extension-link@^3.34.0 @tiptap/extension-placeholder@^3.34.0 @tiptap/extension-subscript@^3.34.0 @tiptap/extension-superscript@^3.34.0 @tiptap/extension-table@^3.34.0 @tiptap/extension-task-item@^3.34.0 @tiptap/extension-task-list@^3.34.0 @tiptap/extension-text-align@^3.34.0 @tiptap/extension-text-style@^3.34.0 @tiptap/extension-typography@^3.34.0 @tiptap/extension-underline@^3.34.0 @tiptap/pm@^3.34.0 @tiptap/react@^3.34.0 @tiptap/starter-kit@^3.34.0 lucide-reactComposition
structure
Usage
rich-text-editor.tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "simple" · "advanced" | "simple" | Simple one-row toolbar, or advanced with a full second row always visible. |
| toolbarCollapsible | boolean | false | On advanced only: collapse row 2 behind an expand control. |
| dir | "rtl" · "ltr" · "auto" | "ltr" | Writing direction on the editor root. Also drives ProseMirror text align. |
| lang | string | "en" | Language attribute on the editor root. |
| value / defaultValue | string · JSONContent | - | Controlled or uncontrolled HTML/JSON content. |
| onChange | (payload: { html; json }) => void | - | Fires on every TipTap update with HTML and JSON. |
| placeholder | string | "Write something…" | Empty-state placeholder text. |
| disabled / readOnly | boolean | false | Disable interaction or lock content for reading. |
| onUploadImage | (file: File) => Promise<string> | - | Optional uploader for the image dialog. Must return an http(s) URL. |
| hideToolbar | boolean | false | Hide the chrome toolbar (surface only). |
| minHeight | number · string | "16rem" | Minimum height of the ProseMirror surface. |