ZUI

Search documentation

Find a page or a heading.

Document Editor

A block document editor and its read-only viewers, with a toolbar, a bubble, a block menu and a slash menu, over the standard kit of headings, lists, tasks and marks.

tsx

Installation

bash

Usage

tsx
tsx

Editor builds the editor once, on mount, from features and content; to load another document, give it a new key. The toolbar and the menus read the editor it hands to onReady, and draw the items the features contribute. A feature item adds its own feature to features beside the standard kit.

To show a stored document without the editing engine, render Viewer, which a server can render:

tsx

ViewerLive renders the same document through the live editor with editing off, for the reading interactions a static render cannot give.

API reference

Editor

It renders the document with data-editor="document" and the document-editor prose classes its styles key on. Beside the standard kit's block drag handle it draws an "Insert block below" button, which opens the slash menu on a new line.

Viewer

Given theme or forcedMode, it themes its document apart from the page with Editor Theme, in light mode unless forcedMode says otherwise.

ViewerLive

Takes every prop Editor takes except editable and onChange.