> ## Documentation Index
> Fetch the complete documentation index at: https://revise.io/developer/docs/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/editor";
import "@reviseio/editor/style.css";
```

## Documents

<ResponseField name="initialDocuments" type="readonly ReviseDocumentInput[]">
  Documents to open on mount. Each needs a host-owned `id` and a `source`:
  DOCX, ODT, RTF, Markdown, plain text, or HTML (see [input
  formats](/developer/docs/developer/docs/editor-sdk/guides/formats)). `docx` is accepted as the older name
  for the same field. A document joining an
  established [collaborative](/developer/docs/developer/docs/editor-sdk/guides/collaboration) room needs no
  source.
</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>

## Behavior

<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 in every open document. Override per document
  with `ReviseDocumentInput.role`. Unlike `defaultDocumentMode`, this is a
  limit, not a starting point: a `suggester` cannot switch to editing mode, and
  agent tool calls that would edit directly are refused.
  See [roles](/developer/docs/developer/docs/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](/developer/docs/developer/docs/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](/developer/docs/developer/docs/editor-sdk/guides/delegated-agent).
</ResponseField>

<ResponseField name="defaultDocumentMode" type="&#x22;editing&#x22; | &#x22;suggesting&#x22; | &#x22;viewing&#x22;" default="&#x22;editing&#x22;">
  The mode each document opens in. This is not a controlled prop. Use
  `view.setDocumentMode()` to change an open 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 remain the fallback, so
  this changes speed only, not behavior.
</ResponseField>

<ResponseField name="fonts" type="readonly ReviseFontDefinition[]">
  Fonts added to the native picker. Your app loads the font files.
</ResponseField>

<ResponseField name="onImageUpload" type="(file: File, documentId: string) => Promise<string>">
  Store an image the user inserts, pastes, or drops, and resolve to the URL the
  document should reference — your CDN or object storage. Without it, images
  are embedded in the document as data URLs, which export into the .docx like
  any other image but make the document larger. A rejection shows the user a
  notice and reaches `onError`. Files over 10 MB are refused before upload.
</ResponseField>

<ResponseField name="onImportFile" type="(file: File, documentId: string) => void">
  Shows Import before Export in the ribbon, with a file picker for DOCX, ODT,
  RTF, Markdown, HTML, text, and XML, and accepts a document file dropped
  anywhere on the editor, with a "Drop to import" overlay. Image drops still
  insert images. The editor only collects the file: what importing means,
  such as opening it as a new document, is up to you.
</ResponseField>

## Chrome

<ResponseField name="toolbarMode" type="&#x22;native&#x22; | &#x22;compact&#x22; | &#x22;floating&#x22; | &#x22;none&#x22;" default="&#x22;native&#x22;">
  `"native"` renders the full Revise ribbon. `"compact"` renders the
  everyday-formatting subset, centered, for narrow fixed-width hosts (about
  760px). `"floating"` renders the full ribbon as a centered card over the
  canvas, as in the Revise app. `"none"` renders no toolbar.
</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. Use
  `"browser"` when the editor is 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 color.
</ResponseField>

<ResponseField name="pageBorderColor" type="string">
  The outline around each page. Any CSS color.
</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. Store the handle here.
</ResponseField>

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

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

<ResponseField name="onDocumentsChange" type="(state: ReviseDocumentCollectionState) => void">
  Fires when the set of open documents changes.
</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. These events leave the page
  only through this callback. Names and property shapes are
  internal and may change between versions.
</ResponseField>

<ResponseField name="telemetry" type="boolean" default="true">
  Once per page load, the SDK sends Revise one anonymous ping with its version.
  The browser adds your site's origin. From `localhost` and other
  development hosts, only a daily count per version is kept, never the origin.
  The ping contains no cookies, user data, or document content. Set `false` to turn it off. See
  [license](/developer/docs/developer/docs/editor-sdk/license). The ping is the SDK's only report to Revise.
  It still downloads assets from `https://revise.io` when first needed (math
  fonts, PDF export fonts, the PDF import worker); `setAssetBaseUrl()` points
  it at your own mirror. An [agent](/developer/docs/developer/docs/editor-sdk/guides/delegated-agent), if you
  configure one, talks only to the backend you chose.
</ResponseField>

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

## Helpers

<ResponseField name="createEmptyDocx()" type="Promise<Blob>">
  Returns a blank DOCX. Use it for "New document" actions.

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.