# Collaboration Binds the editor document to a Yjs document, so every peer edits the same shared state. ## Installation ```bash npx shadcn@latest add litingyes/blocove/rich-text-editor-collaboration ``` > Typography requires [shadcn/typeset](https://ui.shadcn.com/docs/typeset). Copy `typeset.css` next to your main stylesheet, import it after Tailwind and add the `.typeset-docs` preset. This example also uses: `rich-text-editor-collaboration`, `rich-text-editor-text`, `rich-text-editor-paragraph`, `rich-text-editor-hard-break`. ```bash npx 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-break ``` 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. ## API Reference ### EditorCollaboration Binds the editor to a Yjs document through the collaboration extension. | Prop | Type | Default | | --- | --- | --- | | `document` | `Y.Doc` | `required` | | `field` | `string` | `"default"` | ## Registry dependencies - `litingyes/blocove/rich-text-editor-extension` Namespace: `npx shadcn@latest add @blocove/rich-text-editor-collaboration`