Import
Parameters
Content
required
Initial editor content. Accepts TipTap JSON or an HTML string.
Ignored when collaboration extensions are detected (the collab provider manages content).
Extensions[]
default:"[]"
Additional extensions to load.
StarterKit is always included automatically,
so you only need to pass extra extensions (e.g., EmailTheming, custom nodes).(editor: Editor, transaction: { getMeta }) => void
Called on every content change. The
transaction object provides metadata about the change.(payload: string | File, view: EditorView) => boolean
Custom paste handler. Return
true to prevent default paste behavior.(file: File, view: EditorView, pos: number) => void
Called when an image is pasted or dropped. Use this to upload the image and insert
the resulting URL.
(editor: Editor | null) => void
Called once when the editor has finished initializing.
boolean
default:"true"
Toggle read-only mode. When
false, the editor content cannot be modified.UseEditorOptions
are also accepted and forwarded to the underlying TipTap editor.
Return value
Editor | null
The TipTap editor instance.
null until the editor is mounted.boolean
Whether the document is visually empty (only contains an empty paragraph).
Excludes
globalContent nodes from the calculation.Extensions[]
The effective extensions array, including
StarterKit and UndoRedo (unless collaborative).Error | null
Content validation error, if the provided content is invalid for the current schema.
When set, the editor is automatically made read-only.
boolean
Whether collaboration extensions (Liveblocks, Y.js) were detected in the extensions array.
Collaboration support
When collaboration extensions are detected (
liveblocksExtension or collaboration), the
hook automatically:- Ignores the
contentparameter (content is managed by the collab provider) - Excludes the
UndoRedoextension (collab extensions handle their own history)
Example
UseuseEditor directly when you need more control than EditorProvider offers: