Open a document
A document is aFile, Blob, or ArrayBuffer in any of the supported
formats. Pass documents in initialDocuments, or
open them at runtime:
open() resolves to a ReviseDocumentHandle when the document is parsed and
ready. A new document becomes active by default. Pass { activate: false } to
open it in the background.
Per-document options
Any editor-wide option can be overridden per document:Switch and close
Observe the document list
status of "opening", "ready", or "error", and an
error string when parsing failed. Use them to render tabs with loading and
error states.
Controlled or uncontrolled
By default, the component tracks the active document. To control it from your own state, passactiveDocumentId and handle onActiveDocumentChange:
defaultActiveDocumentId sets the initial active document without controlling it.
Export
Read content
Read the document tree for your own logic, such as word counts, validation, or autosave:onChange(documentId, document) fires on every edit from the user, your
toolbar, or an agent.