RebodocsDocs
Start3
What is Rebodocs
Getting started
Demos to run
Put it in your app8
React component
Headless: your own UI
A complete interface
Without a framework
Only to read: the viewer
Styling and Tailwind
Phones and touch
Accessibility
Documents8
Templates and variables
On a server: DOCX and PDF
Documents in an S3 bucket
Letterheads
Versions
Tracked changes
Fonts
Languages
Together2
Real-time collaboration
AI assistants (MCP)
Reference5
Packages
Components and hooks
Editor API
How it works
Status and roadmap
↑↓ to move↵ to openEsc to close26 pages

Start Demos to run

Demos to run

Eight applications in the repository use the packages the way yours would. Each is small, and is there to be read and copied from.

tip: the first one opens right here
apps/demo

The React package

The same agreement in two tabs. On this site it is at /demo, which takes the whole window.

Run it
npm run demo
Opens at
http://localhost:5175
Needs
Nothing
  • The included one. DocsEditor: the whole editor in a dozen lines.
  • Your own interface. A toolbar, a rail, panels, a find bar, a ruler and a status bar built on DocsProvider, DocsSurface and the hooks. It does everything the first does.
  • Two languages. It opens in English; the selector in its status bar puts both the library and the demo’s own labels in Spanish. Those are in src/headless/texts.ts, which follows the language of the editor.
  • No backend. Saving hands the file back as a download.

apps/demo, as this site builds it: the included editor and your own interface, on the same agreement.

Full window

A complete interface walks through it, piece by piece.

apps/storage

An S3 bucket

The port is part of the origin the bucket is told to let in, so it is always 5176.

Run it
npm run storage
Opens at
http://localhost:5176
Needs
A bucket and its keys in apps/storage/.env
  • The list. The .docx and .pdf in the bucket.
  • Signed addresses. Opening and saving with addresses signed for a few minutes: the browser reads from and writes to the bucket itself, and never has a key.
  • Versions. One kept with each save, under versions/; the side panel compares the document with one and goes back to it.
  • PDF on the server. The server fills the variables of a template, lays it out with font files and stores the PDF beside it.

Documents in an S3 bucket has every step for Cloudflare R2, what changes for another S3, and the code to copy.

apps/realtime

Real time

The documents are kept in a folder, or in a bucket when its .env names one. The collaboration server starts with it, on port 7421.

Run it
npm run realtime
Opens at
http://localhost:5177
Needs
Nothing
  • Every document is a room. There is no other way to open one.
  • A room is there only while someone is in it. It opens when the first person comes in; a moment after the last one leaves, the document is saved and the room let go of. The list says which rooms are open, and who is in each.
  • The collaboration server keeps nothing. A backend gives it the document, takes it back, and says who may come in, with a signed ticket for each person.
  • A version of each session. When everybody has left a document they changed, the backend keeps a version, signed by who changed it. The Versions tab lists them, compares, goes back to one, and keeps one by hand.

Open a document, press Copy link and open the link in another window. Real-time collaboration explains each part.

apps/assistant

Claude in the editor

The real-time demo with a chat beside the document. The documents are kept in a folder, or in a bucket as in the storage demo.

Run it
npm run assistant
Opens at
http://localhost:5179
Needs
A key of the Claude API in apps/assistant/.env
  • Ask for something to be done. “Translate it into English keeping the format”, “put the obligations in two columns”, “make the table repeat its heading row”. Claude reads the document, does it with the same tools the MCP server has, and says what it did.
  • What it does is yours. Each change is a step to undo and, in a room, the others see it happen.
  • The key stays on the server. The page sends the conversation to its backend, which takes it to the Claude API; the tools run in the page.

AI assistants has the code to put it in an application.

apps/crm

Inside a CRM

A made-up real-estate CRM, in Spanish, where the documents never leave the page of their property.

Run it
npm run crm
Opens at
http://localhost:5180
Needs
Nothing; a key of the Claude API for its assistant
  • From the record to the contract. Documentos → Generar contrato de mediación fills a template with the record’s data, in Spanish, and opens it in the page as its first version.
  • Saved on its own. A moment after each change; the bar says when. Leaving the document keeps a version, signed by who worked on it.
  • Review. Switch “Trabajas como”, at the top, to Luis Mena · Jurídico and turn on tracked changes: what they change stays marked with their name.
  • The assistant beside the document, as in the demo above, without the rooms.

The documents are kept in the browser, in IndexedDB: in a CRM of your own, src/store.ts is the file that becomes calls to your backend. Its README says what to change.

apps/viewer

Only to read

@rebodocs/viewer, the package for an application that shows documents and does not edit them.

Run it
npm run viewer
Opens at
http://localhost:5181
Needs
Nothing
  • A shelf. Four documents to start with, three of them saved by Word, each with its first page made into a picture in the page by pagePicture. Open .docx adds more.
  • A reader. One of them in DocsViewer: one page under another or all at once, and printed.
  • On a phone. Its server listens on the network: open it at the address of your computer.
  • No backend. Nothing leaves the page.

A document only to read is its page here.

apps/desktop

The desktop

A window of its own, made with Tauri.

Run it
npm run desktop
Needs
Rust, from rustup.rs; the first run compiles for a few minutes
  • Each window is a document, a .docx file of the disk. Open, Save and Save as use the dialogs of the system, and closing a window with changes asks first.
  • A native menu: File, Edit, View, with the usual keys. Edit has Paste as text.
  • Export as PDF to a file of the disk, and the other exports of the side menu.
  • Documents from the system: dropped on the window, or opened with a double click in the Finder or the Explorer once the application is built (npm run build:desktop).

The pages are the editor without a framework, as in the playground; what Rust adds is small, in src-tauri/src/lib.rs: reading and writing files, a window per document, and the documents the system asks to open.

apps/playground

The playground

The page every package is tried in while it is written.

Run it
npm run dev
Opens at
http://localhost:5173
Needs
Nothing
  • No framework. The editor and every piece around it, wired by hand.
  • Share. Collaboration started from the Share button in the status bar, on the collaboration server of this machine (npm run collab).
  • An assistant. The MCP server reaches the document open in it (npm run mcp).

Its src/main.ts is the shortest example of everything wired together. See Without a framework.

All of them

What they have in common

From their source

They take the packages from their source, so a change in a package shows at once. Copied into a project that installs @rebodocs/react from npm, they work without the alias in vite.config.ts.

For your machine

The ones with a backend check nobody: where an application decides who may do what is marked in their code. The ones with Claude spend from your API key, a few steps a minute for each address.

A README each

Each says what is where, and where it can improve.