Appearance
Theme, colors, fonts, zoom, and container sizing.
Theme#
theme accepts "light" (default) or "dark" and is scoped to that editor instance without modifying the surrounding page:
<ReviseEditor theme="dark" initialDocuments={docs} />Colors#
Configure three surfaces via props or CSS custom properties on the editor root:
| Prop | CSS variable | Surface |
|---|---|---|
canvasBackground | --revise-canvas-background | Backdrop behind pages (any CSS background, including gradients) |
pageBackground | --bg-page | Page surface, image placeholders, container fills, and table cell defaults |
pageBorderColor | --page-border | Page outline |
<ReviseEditor
canvasBackground="#b9c6bf"
pageBackground="#faf6ef"
pageBorderColor="#42524f"
initialDocuments={docs}
/>Fonts#
Register custom fonts for the picker, separating the DOCX family name from the browser CSS stack:
<ReviseEditor
fonts={[
{
family: "Counsel Sans",
label: "Counsel Sans",
cssFamily: "'Counsel Sans', Arial, sans-serif",
fontWeight: 500,
},
]}
initialDocuments={docs}
/>family is written into the document and .docx; cssFamily is used for browser rendering only.
Load font files yourself via @font-face or a stylesheet. Unloaded families
render in a fallback font in the browser while still exporting the declared
family to .docx.
Zoom#
zoom accepts any positive number or "fit-width" (default):
<ReviseEditor defaultZoom="fit-width" initialDocuments={docs} />editor.zoom.setZoom(1.25);
editor.zoom.fitWidth();
const { zoom, scale } = editor.zoom.getState();
useEffect(() => editor.zoom.subscribe(setZoomState), [editor]);zoom is the requested setting; scale is the effective canvas scale. For "fit-width", scale recomputes when the container width or comments panel changes. Numeric zoom stays fixed and scrolls horizontally.
WASM hot paths#
Rust/WASM acceleration for word diffing, agent text matching, and document statistics is opt-in and available only via the revise/full entry point (not CSP-safe):
import ReviseEditor from "revise/full";
<ReviseEditor wasmHotPaths initialDocuments={docs} />;The binary is inlined in revise/full. If WebAssembly is unavailable, the editor falls back to identical TypeScript implementations.
Container size#
The editor fills its parent container (className and style apply to the editor root):
<div style={{ height: "80vh" }}>
<ReviseEditor initialDocuments={docs} />
</div>