> ## Documentation Index
> Fetch the complete documentation index at: https://developer.revise.io/llms.txt
> Use this file to discover all available pages before exploring further.

# <ReviseEditor />

> Every prop on the editor component.

```tsx theme={null}
import { ReviseEditor } from "@reviseio/sdk";
import "@reviseio/sdk/style.css";
```

## Documents

<ResponseField name="initialDocuments" type="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](/editor-sdk/guides/formats). A document joining an
  established [collaborative](/editor-sdk/guides/collaboration) room needs no source at
  all.
</ResponseField>

<ResponseField name="activeDocumentId" type="string | null">
  Controlled active document. Pair with `onActiveDocumentChange`.
</ResponseField>

<ResponseField name="defaultActiveDocumentId" type="string | null">
  Initial active document for uncontrolled use. Defaults to the first document.
</ResponseField>

## Behaviour

<ResponseField name="currentUser" type="EditorUserIdentity | null">
  Identity attached to comments and suggestions the user authors.
</ResponseField>

<ResponseField name="role" type="&#x22;editor&#x22; | &#x22;suggester&#x22; | &#x22;viewer&#x22;" default="&#x22;editor&#x22;">
  What this participant may do, across every open document; override per
  document with `ReviseDocumentInput.role`. Unlike `defaultDocumentMode` this
  is a boundary rather than a starting point — a `suggester` cannot reach
  editing mode, and agent tool calls that would edit directly are refused.
  See [roles](/editor-sdk/guides/roles).
</ResponseField>

<ResponseField name="settings" type="ReviseEditorSettings">
  Behavior settings. `settings.trackedChanges.markupStyle: "word"` switches
  the canvas to classic Word-style redlines (all revisions in red, insertions
  underlined, deletions struck through, no background tint);
  `settings.trackedChanges.showRemovalsInReview: true` starts review with
  deleted text visible inline. See [tracked changes](/editor-sdk/guides/tracked-changes).
</ResponseField>

<ResponseField name="agent" type="ReviseAgentConfig">
  Backend, credentials, model, or a custom transport for the delegated agent.
  See [delegating to the Revise agent](/editor-sdk/guides/delegated-agent).
</ResponseField>

<ResponseField name="defaultDocumentMode" type="&#x22;editing&#x22; | &#x22;suggesting&#x22; | &#x22;viewing&#x22;" default="&#x22;editing&#x22;">
  Seeds the mode for documents as they open. Not a controlled prop — use
  `view.setDocumentMode()` to change a live document.
</ResponseField>

<ResponseField name="defaultZoom" type="number | 'fit-width'" default="fit-width">
  Initial zoom.
</ResponseField>

<ResponseField name="defaultCommentsOpen" type="boolean" default="true">
  Whether the comments panel starts open.
</ResponseField>

<ResponseField name="autoFocus" type="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.
</ResponseField>

<ResponseField name="wasmHotPaths" type="boolean" default="false">
  Opt in to the Rust/WASM accelerations for word diff, agent text matching, and
  document statistics. The TypeScript implementations stay as the fallback, so
  this changes speed only, never behaviour. Off by default while it proves
  itself in the field.
</ResponseField>

<ResponseField name="fonts" type="readonly ReviseFontDefinition[]">
  Fonts added to the native picker. Loading the font files remains yours.
</ResponseField>

## Chrome

<ResponseField name="toolbarMode" type="&#x22;native&#x22; | &#x22;none&#x22;" default="&#x22;native&#x22;">
  Render Revise's ribbon, or nothing at all.
</ResponseField>

<ResponseField name="showTitleBar" type="boolean" default="true">
  The bar above the ribbon: editable title, optional mode toggle, Review.
</ResponseField>

<ResponseField name="showTabs" type="boolean" default="false">
  Built-in tab strip, one tab per open document.
</ResponseField>

<ResponseField name="findShortcut" type="&#x22;editor&#x22; | &#x22;browser&#x22;" default="&#x22;editor&#x22;">
  Who handles Cmd/Ctrl+F. `"editor"` opens the built-in find-and-replace
  panel; `"browser"` leaves the shortcut to the browser's native find, which
  suits an editor embedded in a longer page.
</ResponseField>

<ResponseField name="showDocumentModeToggle" type="boolean" default="false">
  Show the Editing/Suggesting toggle in the title bar.
</ResponseField>

<ResponseField name="onNewTab" type="() => void">
  Adds a "+" button to the tab strip. Without it, no button renders.
</ResponseField>

## Appearance

<ResponseField name="theme" type="&#x22;light&#x22; | &#x22;dark&#x22;">
  Scoped to this editor. Defaults to the host page's theme.
</ResponseField>

<ResponseField name="canvasBackground" type="string">
  The area behind the page. Any CSS background.
</ResponseField>

<ResponseField name="pageBackground" type="string">
  The paper itself. Any CSS colour.
</ResponseField>

<ResponseField name="pageBorderColor" type="string">
  The outline around each page. Any CSS colour.
</ResponseField>

<ResponseField name="className" type="string" />

<ResponseField name="style" type="React.CSSProperties" />

## Callbacks

<ResponseField name="onReady" type="(editor: ReviseEditorHandle) => void">
  Fires once the editor is mounted. This is where you keep the handle.
</ResponseField>

<ResponseField name="onDocumentReady" type="(document: ReviseDocumentHandle) => void">
  Fires per document, once it has parsed and is ready to read or edit.
</ResponseField>

<ResponseField name="onChange" type="(documentId: string, document: ReviseDocument) => void">
  Any content change, from the user, your UI, or an agent. Debounce before
  persisting.
</ResponseField>

<ResponseField name="onDocumentsChange" type="(state: ReviseDocumentCollectionState) => void">
  The open-document collection changed.
</ResponseField>

<ResponseField name="onActiveDocumentChange" type="(documentId: string | null) => void" />

<ResponseField name="onDocumentTitleChange" type="(documentId: string, title: string) => void" />

<ResponseField name="onDocumentModeChange" type="(documentId: string, mode: ReviseDocumentMode) => void" />

<ResponseField name="onZoomChange" type="(documentId: string, zoom: ReviseZoom) => void" />

<ResponseField name="onAgentEvent" type="(documentId: string, event: ReviseAgentEvent) => void" />

<ResponseField name="onAnalyticsEvent" type="(event: string, properties?) => void">
  The editor's internal instrumentation — tool invocations, exports, review
  interactions — delivered to your own analytics. The SDK sends telemetry
  nowhere itself; this callback is the only place events go. Names and
  property shapes are internal and may change between versions.
</ResponseField>

<ResponseField name="onError" type="(error: Error, documentId?: string) => void">
  Parse failures and runtime errors. Documents that fail to open also surface
  as `status: "error"` in the collection state.
</ResponseField>

## Helpers

<ResponseField name="createEmptyDocx()" type="Promise<Blob>">
  A blank DOCX, for "New document" actions.

  ```ts theme={null}
  import { createEmptyDocx } from "@reviseio/sdk";
  ```
</ResponseField>
