Collaboration
Binds the editor document to a Yjs document, so every peer edits the same shared state.
The Yjs document is the source of truth: once this extension is declared the editor stops seeding its content from `value` or `defaultValue`, and the local undo history steps aside for the one collaboration owns. Create the document and the provider in your app, connect them to a Hocuspocus server, and pass the same document to every editor.
Preview
Installation
Add the item with the shadcn CLI, or copy the source manually.
pnpm dlx shadcn@latest add litingyes/blocove/rich-text-editor-collaborationRequires a shadcn/ui project set up with Base UI primitives. Blocove is developed against the b0 preset, but it installs no base config or theme tokens: your own preset, fonts and colors stay in place.
Or install from the namespace after adding the registry: npx shadcn@latest add @blocove/rich-text-editor-collaboration
This example also uses: rich-text-editor-collaborationrich-text-editor-textrich-text-editor-paragraphrich-text-editor-hard-break
pnpm dlx shadcn@latest add litingyes/blocove/rich-text-editor-collaboration litingyes/blocove/rich-text-editor-text litingyes/blocove/rich-text-editor-paragraph litingyes/blocove/rich-text-editor-hard-breaktypeset.css next to your stylesheet, import it after Tailwind and add the .typeset-docs preset. See the Rich text editor setup.API Reference
Props accepted by the exported components.
EditorCollaboration
Binds the editor to a Yjs document through the collaboration extension.
| Prop | Type | Default |
|---|---|---|
document | Y.Doc | required |
field | string | "default" |