Skip to main content
Mount the editor with client.mountEditor(el, options). el is an Element or a CSS selector string. It returns an EditorInstance for imperative control.
The editor owns an internal scroll view (pinned toolbar, scrolling body) and fills its container — give the host element a bounded height (e.g. a sized dialog body or height: 70vh).

EditorMountOptions

string
Existing document id to load. Omit to lazy-create a document on the first content change — the new id arrives via onDocumentCreated.
Json | null
Initial content (TipTap JSON) when not loading from a documentId — in-memory editing.
"en" | "ar"
Editor UI and content language/direction.
"light" | "dark"
Color theme. Can be changed live via setTheme.
boolean
default:"false"
Start read-only. Editing can be toggled later via setEditable().
boolean
AutosaveOptions
Autosave behavior. See Types. Set { enabled: false } to drive persistence yourself via save().

Callbacks

() => void
Fired once the editor is mounted and (if loading) the document is in.
(json: Json) => void
Fired on every content change with the current TipTap JSON.
(state: SaveState) => void
Fired when autosave transitions between idle | saving | saved | error.
(id: string) => void
Fired with the new id when a document is lazy-created.
(code: ErrorCode, detail?: unknown) => void
Fired on recoverable/unrecoverable errors with a stable error code.
() => void
Fired when a forced token refresh fails; autosave pauses until recovery.
(name: string, props?) => void
Analytics passthrough for editor interaction events.

EditorInstance

The object returned by mountEditor:
Json | null
Current editor content (TipTap JSON).
Promise<void>
Force an immediate save of any pending changes.
void
Toggle read-only / editable live.
void
Switch theme ("light" | "dark") live.
void
Tear down the editor and release the shared overlay root. Call this on unmount.

Manual save (autosave off)