Presence

The online collaborator avatar stack and the connection status of the provider.

UIrich-text-editor-presenceView JSON

Both components read the provider awareness and render nothing until a peer advertises itself. The caret publishes the user record for you; when the document has no caret item, set it with `provider.setAwarenessField("user", …)`. The status item is the honest half of a demo: it shows Offline instead of pretending the document is shared when the websocket is down.

Preview

Installation

Add the item with the shadcn CLI, or copy the source manually.

pnpm dlx shadcn@latest add litingyes/blocove/rich-text-editor-presence

Requires 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-presence

This example also uses: rich-text-editor-presencerich-text-editor-collaborationrich-text-editor-textrich-text-editor-paragraphrich-text-editor-hard-break

pnpm dlx shadcn@latest add litingyes/blocove/rich-text-editor-presence 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
Typography is provided by shadcn/typeset. Copy typeset.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.

EditorPresence

The avatar stack of the peers currently in the document.

PropTypeDefault
providerCollaborationProviderrequired
maxnumber4
classNamestring-

EditorCollaborationStatus

The connection state of the provider: live, connecting or offline.

PropTypeDefault
providerCollaborationProviderrequired
classNamestring-