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

Reference Packages

Packages

Six packages, each for one thing, all on npm at the same version, 0.13.0. Most applications need one.

tip: press ⌘K to jump to any package
Start here

Which one do I install?

Pick what you are making. The drawing shows what you install, what comes inside it, and who uses whom.

corecomes insideeditorcomes insidecollabcomes insidemcpnot neededviewercomes insidereactinstall it
Install itComes inside what you installNot neededuses

One install: the engine, the editor and the collaboration client come inside.

One engine, not two. @rebodocs/react is built as one file with the engine, the editor and the collaboration client inside. The others ask npm for @rebodocs/core and share one copy of it, so a Doc made with core is the one they take. An application that installs both @rebodocs/react and @rebodocs/core has the engine twice.

At a glance

Where each one runs

The six side by side: where each runs, what it is built for, and what it brings with it.

  • All six:
  • ESM only
  • TypeScript types included
  • Tree-shakeable
  • MIT
PACKAGE
RUNS IN
BUILT FOR
DEPENDS ON
Browser · Safe to render on a server
ES2022 browsers
React 18+ (peer)
@rebodocs/editorNo framework
Browser
ES2022 browsers
@rebodocs/core
Browser · Safe to render on a server (React)
ES2022 browsers
@rebodocs/editor@rebodocs/coreReact 18+ (optional peer)
Node · Browser
ES2022: Node and browsers
fflate
Node (the server) · Browser (the client)
Node 22 (server) · ES2022 (client)
@rebodocs/core
Node (the server) · Browser (the editor’s side)
Node 22 (server) · ES2022 (browser side)
@rebodocs/core@anthropic-ai/sdk

Same version, all of them. Every package is published at the same version, and they expect each other at it: update them together. Rebodocs is 0.x and pre-release, so a new version may change an API; what is done and what is coming is in Status and roadmap.

6 packages

The packages

One at a time: how to get it, what it has, and the least code that uses it.

@rebodocs/react

ReactREADME →On npm →

The editor for React: the whole of it as one component, or the pages and hooks to draw your own.

  • Browser
  • Safe to render on a server
  • ES2022 browsers

Get it

Everything it needs is inside: one install.

Depends on

React 18+ (peer)

What is inside

DocsEditor
The whole editor as a component: toolbar, ruler, side panel, pages, status bar.
DocsProvider, DocsSurface, hooks
The pages, and thirteen hooks to build an interface of your own.
mountDocs, createDocs
The same two, with no React in them.
DocsViewer
A document only to read, the component of @rebodocs/viewer.
Built in
The engine, the editor, the viewer and the collaboration client, in one bundle.

Import it from

@rebodocs/react
The components, the hooks, createDocs, languages and fonts.
@rebodocs/react/mount
mountDocs: the whole editor in an element, without React.

Take it

For a React or Next.js application. It is the one an application installs first.

Use it

'use client';
import { DocsEditor } from '@rebodocs/react';

export function Contract({ file }: { file: Uint8Array }) {
  return (
    <div className="h-screen">
      <DocsEditor docx={file} name="contract.docx" locale="en" onSave={(docx, name) => upload(docx, name)} />
    </div>
  );
}
8 applications

The applications

Besides the packages, the repository has small applications that use them: each one a way of putting the editor in a product. See Demos to run.

apps/playground

The page every package is tried in. Its src/main.ts is the shortest example of everything wired together.

$ npm run dev
apps/demo

@rebodocs/react as an application uses it: the whole editor, and an interface of its own on the hooks.

apps/viewer

Documents only to read: a shelf of them with their thumbnails, and each one opened in the viewer.

$ npm run viewer
apps/storage

Documents in an S3 bucket: open, save, and a PDF made on the server.

apps/realtime

Several people on one document, through a backend with its three routes and signed tickets.

$ npm run realtime
apps/assistant

Claude in a chat beside a shared document: the page runs the tools, the backend talks to the Claude API.

apps/desktop

The editor as a desktop application, with Tauri: .docx files on disk, a native menu, PDF.

$ npm run desktop
apps/site

This website.