Documents
readonly ReviseDocumentInput[]
Documents to open on mount. Each needs a host-owned
id and a source. The
source field is named docx but accepts DOCX, Markdown, plain text, and
HTML — see input formats.string | null
Controlled active document. Pair with
onActiveDocumentChange.string | null
Initial active document for uncontrolled use. Defaults to the first document.
Behaviour
EditorUserIdentity | null
Identity attached to comments and suggestions the user authors.
ReviseAgentConfig
Backend, credentials, model, or a custom transport for the delegated agent.
See delegating to the Revise agent.
"editing" | "suggesting" | "viewing"
default:"\"editing\""
Seeds the mode for documents as they open. Not a controlled prop — use
view.setDocumentMode() to change a live document.number | 'fit-width'
default:"fit-width"
Initial zoom.
boolean
default:"true"
Whether the comments panel starts open.
boolean
default:"true"
Take keyboard focus when a document becomes active. Set
false when the
editor sits inside a larger page and should wait for a click.readonly ReviseFontDefinition[]
Fonts added to the native picker. Loading the font files remains yours.
Chrome
"native" | "none"
default:"\"native\""
Render Revise’s ribbon, or nothing at all.
boolean
default:"true"
The bar above the ribbon: editable title, optional mode toggle, Review.
boolean
default:"false"
Built-in tab strip, one tab per open document.
boolean
default:"false"
Show the Editing/Suggesting toggle in the title bar.
() => void
Adds a ”+” button to the tab strip. Without it, no button renders.
Appearance
"light" | "dark"
Scoped to this editor. Defaults to the host page’s theme.
string
The area behind the page. Any CSS background.
string
The paper itself. Any CSS colour.
string
The outline around each page. Any CSS colour.
string
React.CSSProperties
Callbacks
(editor: ReviseEditorHandle) => void
Fires once the editor is mounted. This is where you keep the handle.
(document: ReviseDocumentHandle) => void
Fires per document, once it has parsed and is ready to read or edit.
(documentId: string, document: DocRoot) => void
Any content change, from the user, your UI, or an agent. Debounce before
persisting.
(state: ReviseDocumentCollectionState) => void
The open-document collection changed.
(documentId: string | null) => void
(documentId: string, title: string) => void
(documentId: string, mode: ReviseDocumentMode) => void
(documentId: string, zoom: ReviseZoom) => void
(documentId: string, event: ReviseAgentEvent) => void
(error: Error, documentId?: string) => void
Parse failures and runtime errors. Documents that fail to open also surface
as
status: "error" in the collection state.Helpers
Promise<Blob>
A blank DOCX, for “New document” actions.