Skip to main content

Theme

The theme prop sets the editor theme independently of the host page. Several editors on one page can use different themes, and a dark editor can sit in a light application.
Without theme, the editor follows the host page.
The theme applies to the editor and its canvas only. It does not change the surrounding page.

Colors

Three surfaces have their own colors. Set each with a prop or with a CSS custom property on the editor root.
All three accept any CSS value, including gradients for the canvas:
pageBackground also applies inside the canvas. Image placeholders, container fills, and table cell backgrounds use your color instead of white.

Fonts

Add your application’s fonts to the font picker. The DOCX family name and the browser font stack are set separately:
family is stored in the document and written to .docx. cssFamily is used only to render the font in the browser.
The SDK does not load font files. Load them with @font-face or a stylesheet. A family that is not loaded renders in a fallback font and still exports correctly.

Zoom

Zoom accepts any positive scale or "fit-width":
zoom is the requested value. scale is the actual canvas scale. For "fit-width", scale is computed from the widest page and updates when the container or the comments stack changes. An expanded comments stack reduces the available width. A numeric zoom stays fixed, and the editor scrolls horizontally. Subscribe to zoom changes:

Performance

Word-level diffing, agent text anchoring, and document statistics have Rust/WASM implementations. They are off by default:
The binary is included in the package. There is nothing to host or configure. If WebAssembly is unavailable, the editor uses the TypeScript implementations. Both produce the same output.

Container size

The editor fills its container. Give it a sized parent:
className and style are passed to the editor root.