<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400..600;1,9..144,400..600&family=Imperial+Script&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap" />

Search the Qalma docs

Type at least two characters to get started.

Docs

Unique IDs

UniqueIdPlugin adds stable IDs to selected node types. Paragraphs are the default:

const editor = createQalmaEditor({
  plugins: [
    HeadingsPlugin,
    BlockquotePlugin,
    UniqueIdPlugin.configure({
      nodeTypes: ['paragraph', 'heading', 'blockquote'],
      attributeName: 'data-qalma-id',
    }),
  ],
});

IDs live in lossless JSON as attrs.qalmaId and round-trip through HTML via the configured data-* attribute. Existing IDs are preserved; missing or duplicate IDs receive fresh values after mounting or a document-changing transaction.

The uniqueId query returns the nearest configured node at the selection:

const block = editor.query<UniqueIdState>('uniqueId');
// { id, nodeType, position } | null

Pass generateId when your product has its own identifier policy. It must return a non-empty unique string. Stable IDs are useful for comments, annotations, server diffs, and future collaboration metadata; they do not themselves implement collaboration.