Dotvoid

Textbit

An open-source rich-text editor for editorial work. Built on Slate and slate-yjs, designed for real-time editing, written to be read. Below, the same editor runs four different ways: a structured document, a read-only rendering, two peers sharing a Y.Doc, and a single-line collaborative input. Every editor is live - try them.

A document of blocks.

A Slate Descendant[] of typed blocks: headings, paragraphs, lists, blockquotes, tables and code blocks. Each block is rendered by the component the plugin registers for it.

  • Open the gutter on the left to change a block's role or insert a new one.
  • The block caret and Shift-arrow block selection work here.
  • Structure is kept valid by plugin normalisers as the user types.

Same content, frozen.

The same document rendered with readOnly. Useful for previews, server-rendered views, and anywhere the document is display-only. Plugin components still render; editing is simply off.

  • All interaction - typing, gutter, drag - is disabled.
  • Selection and copy still work.

Two peers, one document.

A single Y.Doc shared between two editors in the same page. Each gets its own Awareness identity (Alice and Bob) and edits flow through the Yjs CRDT - the same transport void0 uses for real multi-user collaboration.

  • Type in Alice's editor. It appears in Bob's.
  • Selection and cursor presence are shared through Awareness.
  • Swap the in-memory doc for a websocket provider to go remote.

Drop it in as a form field.

Textbit doesn't have to be a document editor. Bind the same Yjs-backed root to a single-line, plugin-less configuration and it becomes a drop-in replacement for an <input>: two people editing the same headline, byline, or slug with presence, undo and offline reconciliation handled by the CRDT.

  • One shared Yjs text node. Nothing more than a single-line text plugin.
  • Type in either field. The other mirrors it in real time.
  • Everywhere a form takes text, a collaborative form can take it instead.