21 / 24
21API Reference
Component props and configuration
EditorProvider
Wraps your editor and provides the Zustand store context for all editor operations.
| Prop | Type | Default | Description |
|---|---|---|---|
| initialContainer | ContainerNode | - | Initial content structure (alternative to initialState) |
| initialState | EditorState | - | Complete initial state including history and metadata |
| onChange | (state: EditorState) => void | - | Callback fired on every state change |
| debug | boolean | false | Enable debug logging to console |
| children | ReactNode | - | Editor components to render |
Editor
The main editor component that renders the editing interface.
| Prop | Type | Default | Description |
|---|---|---|---|
| readOnly | boolean | false | View-only mode -- renders content without editing capabilities |
| onUploadImage | (file: File) => Promise<string> | - | Custom image upload handler -- return the uploaded URL |
| notionBased | boolean | true | Enable Notion-style features (cover image, first header spacing) |
| onNotionBasedChange | (v: boolean) => void | - | Callback when Notion mode is toggled |
CompactEditor
Self-contained editor with built-in provider and inline toolbar.
| Prop | Type | Default | Description |
|---|---|---|---|
| initialContainer | ContainerNode | - | Initial content structure |
| readOnly | boolean | false | View-only mode |
| onUploadImage | (file: File) => Promise<string> | - | Custom image upload handler |
| onChange | (state: EditorState) => void | - | Callback on state changes |