RichTextEditor
proRichTextEditor combines Tiptap editing with composable formatting tools for notes, comments, and long-form fields.
Installation
Add this component with the NateUI CLI.
Examples
Custom Toolbar
Custom Editor
Invalid
With Form
API
RichTextEditor is coupled to Tiptap by design. Without customEditor, it creates a StarterKit editor and supplies the default toolbar. With customEditor, the caller owns the editor extensions and its update lifecycle.
| Prop | Description | Type | Default |
|---|---|---|---|
content | Initial HTML, and the HTML value applied when the prop changes. | string | '' |
invalid | Applies the destructive editor state. | boolean | false |
customToolBar | Replaces the default toolbar with a renderer receiving the Tiptap editor and the built-in toolbar component map. | RichTextEditorToolbarRenderer | Default toolbar |
onChange | Called by the internally created editor after an update. | (payload: RichTextEditorChangePayload) => void | — |
editorContentClass | Additional classes applied to the EditorContent element. | string | — |
customEditor | Uses a caller-owned Tiptap editor instance instead of creating one internally. | Editor | null | — |
ref | Ref forwarded to the EditorContent root element. | Ref<HTMLDivElement> | — |
...rest | Remaining EditorContent props, excluding editor, ref, and onChange. | EditorContentProps | — |
Compound Toolbar Exports
The default export also exposes the reusable toolbar pieces and update hook:
RichTextEditor.ToolButton, RichTextEditor.ToolButtonBold, RichTextEditor.ToolButtonItalic, RichTextEditor.ToolButtonStrike, RichTextEditor.ToolButtonCode, RichTextEditor.ToolButtonBlockquote, RichTextEditor.ToolButtonHeading, RichTextEditor.ToolButtonParagraph, RichTextEditor.ToolButtonBulletList, RichTextEditor.ToolButtonOrderedList, RichTextEditor.ToolButtonCodeBlock, RichTextEditor.ToolButtonHardBreak, RichTextEditor.ToolButtonHorizontalRule, RichTextEditor.ToolButtonImage, RichTextEditor.ToolButtonUndo, RichTextEditor.ToolButtonRedo, and RichTextEditor.useEditorUpdate.