Configuration
Every option useEditor() and <NoteloomEditor> accept, in one place. Each is also covered in depth on its own page — this is the quick reference, not the full explanation.
useEditor(options)
jsx
const editor = useEditor({
doc: myStarterDoc, // simple format or the internal graph — auto-detected
history: true, // default; false gives a plain store with no undo/redo
currentUserId: user.id, // stamped as each edit's actorId (version history / collab)
extensions: [...starterKit(), myBlock], // recommended — see Custom blocks & extensions
// registerBlocks / registerInlineTypes callbacks also still work (deprecated)
});
// editor === { store, registry, inlineRegistry, extensions, toJSON }
// editor.toJSON() -> simple format
// editor.toJSON({ format: 'internal' }) -> the normalized graph| Option | Type | Default | What it does |
|---|---|---|---|
doc | SimpleDocument | DocumentJSON | one empty paragraph | The starting document — the simple format (what editor.toJSON() returns) or the internal graph (exportDocumentJSON), auto-detected. |
history | boolean | true | Set false for a plain store with no undo/redo tracking. |
currentUserId | string | null | Stamped as every edit's actorId — read by version history and collaboration. |
extensions | Extension[] | — | Recommended. An array of defineBlock() / defineInline() / defineExtension() results (nesting allowed). Passing it turns off automatic built-in registration — spread starterKit() for the usual set. See Custom blocks & extensions. |
registerBlocks / registerInlineTypes | (registry) => void | registers every built-in type | The older callback form — still works, runs after extensions if both are given. Deprecated for removal in a future major. |
<NoteloomEditor> props
jsx
<NoteloomEditor
editor={editor}
className="my-editor"
style={{ '--noteloom-accent': '#16a34a' }}
theme="none" // opt out of the auto-injected default theme
getBlockClassName={(block) => (block.type === 'callout' ? 'my-callout' : undefined)}
commentAuthorId={currentUser.id}
showCommentsPanel
onComment={(range) => { /* full control instead of commentAuthorId's built-in composer */ }}
>
{/* anything here renders after the editor surface — toolbars, modals, panels */}
</NoteloomEditor>| Prop | Type | What it does |
|---|---|---|
editor | result of useEditor() | Required — the wired-up store/registry pair. |
className / style | string / object | Wraps the editor surface in one <div className="be-root ..."> — the hook for scoping --noteloom-* overrides to one instance. See Theming & styling. |
theme | 'default' | 'none' | Default injects the built-in theme automatically; "none" opts out entirely. |
getBlockClassName | (block) => string | undefined | Per-block class names, appended onto that block's own root element. |
commentAuthorId / onComment | string / function | The built-in comment composer, or full control over what happens on "Comment." See Comments. |
showCommentsPanel | boolean | A persistent sidebar listing every comment thread, unresolved first. |
children | React nodes | Rendered after the editor surface, inside the same EditorProvider — the mount point for a toolbar, FieldTypeEditorModal, or anything else that needs editor context. |
Need more control than either of these gives you — a hand-picked subset of hooks, mobile chrome mounted separately, a completely custom surface element? See the granular API in Getting started.