Skip to main content
All UI the SDK draws around the document is optional. Every control’s action is also available from the handle.

Optional chrome

The comments panel has no built-in button. Comment chips render next to the page, and your UI opens or closes the panel.

Ribbon modes

Custom toolbar

Set toolbarMode="none", subscribe to toolbar state, and render your own controls:
ReviseToolbarState includes: ready, readOnly, documentMode, hasSelection, canUndo/canRedo, the formatting marks at the caret, heading, alignment, lineSpacing, fontSizePt, the current blockType, and a review summary.
Subscribe once and call the returned unsubscribe function on unmount. State is published on every selection change.

Toolbar commands

undo, redo, copy, copyAs("plaintext" | "markdown" | "html"), cut, paste, pasteTextOnly, pasteFormattingOnly
toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleDoubleStrikethrough, toggleSmallCaps, toggleAllCaps, toggleCode, toggleLatex, toggleSuperscript, toggleSubscript, clearFormatting, setFontFamily, setFontSize, setLetterSpacing, setTextColor, setHighlightColor
setHeading, setAlignment, setLineSpacing, toggleList, createLink, increaseIndent, decreaseIndent
insertTable, insertImage, insertContainer, insertCodeBlock, insertMathBlock, insertDiagram, insertFootnote, insertPageNumber, insertPageBreak, insertSectionBreak
openReview, closeReview, reviewPrevious, reviewNext, acceptCurrent, rejectCurrent, acceptAll, rejectAll, setShowRemovals, setSuggestionViewMode
A command returns false when it cannot apply, for example in a read-only document, with no selection, or with nothing to undo.

View controller

The view controller sets the title, document mode, and panels:
An Editing/Suggesting toggle:

Built-in tabs

Turn on the built-in document tabs with showTabs:
The + button renders only when you pass onNewTab.

Focus

The editor takes keyboard focus when a document becomes active. To focus it only on click, for example in a preview or split view, set autoFocus={false}: