noteloom

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
OptionTypeDefaultWhat it does
docSimpleDocument | DocumentJSONone empty paragraphThe starting document — the simple format (what editor.toJSON() returns) or the internal graph (exportDocumentJSON), auto-detected.
historybooleantrueSet false for a plain store with no undo/redo tracking.
currentUserIdstringnullStamped as every edit's actorId — read by version history and collaboration.
extensionsExtension[]—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) => voidregisters every built-in typeThe 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>
PropTypeWhat it does
editorresult of useEditor()Required — the wired-up store/registry pair.
className / stylestring / objectWraps 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 | undefinedPer-block class names, appended onto that block's own root element.
commentAuthorId / onCommentstring / functionThe built-in comment composer, or full control over what happens on "Comment." See Comments.
showCommentsPanelbooleanA persistent sidebar listing every comment thread, unresolved first.
childrenReact nodesRendered 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.