Skip to content

Commit

Permalink
doc: how to change name and color for cursors
Browse files Browse the repository at this point in the history
  • Loading branch information
dpnova committed Dec 6, 2024
1 parent 4d07c09 commit bd5b7ac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/www/content/docs/collaboration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ title: Collaboration
## Features

- The yjs plugin enables support for collaboration using [slate-yjs](https://docs.slate-yjs.dev/) and [Hocuspocus](https://docs.slate-yjs.dev/walkthroughs/collaboration-hocuspocus).
- By default remote cursors are rendered slightly faded and become solid on hover.
- By default remote cursors are rendered slightly faded and become solid on hover. Use the `data` field in `cursorOptions` to customise the display name and color.
- To customize, copy `YjsAboveEditable.tsx` and `Overlay.tsx` into your project and override the `options.render.aboveEditable` option to this plugin.

</PackageInfo>
Expand All @@ -36,6 +36,11 @@ const editor = createPlateEditor({
// ...otherPlugins,
YjsPlugin.configure({
options: {
cursorOptions: {
autoSend: true,
data: { name: 'A plate user', color: '#5AC990' },
},
disableCursors: false,
hocuspocusProviderOptions: {
url: 'https://hocuspocus.test/hocuspocus',
name: 'test',
Expand Down

0 comments on commit bd5b7ac

Please sign in to comment.