Docs: Configuration

Props

NameTypeDescription
classNamestringClasses to apply to root editor element.
optionsOptionsInitial configuration options for the editor.
initialStateDescendant[]Initial state of the editor. This is only applied on first render. The editor is an uncontrolled component.
onChange(Descendant[]) => voidCalled every time a change is detected inside the editor.
focusOnMountbooleanFocus (move the cursor into) the editor on mount.

Options

NameTypeDefaultDescription
readOnlybooleanfalseTurn the editor into a readonly uneditable view. Good for previewing a document.
widthInchesnumber8.5Width of the editor in inches.
paddingInchesnumberwidthInches / 17Padding (whitespace on the edges) inside the editor in inches. Calculated by default based on width. Can be overriden.
usableWidthPixelsnumberwidthInches * 96 - paddingInches * 96 * 2Usable width for content inside the editor. Calculated by default based on width and padding. Can be overriden.
singleLinebooleanfalseDisallow linebreaks. Good for a demo of a single block inside the editor.
toolbarOffsetEmnumber1 + paddingInches * 2Horizontal offset of the hovering toolbar in em. Calculated by default based on padding. Can be overriden.

Descendant

NameTypeDescription
typestringType of editor block.

The rest of fields on the Descendant type are dependant on block type.