# Document Editor block

> Tiptap Document Editor With Formatting Toolbar, Link Bubble and Task Lists

Fluid rich text editor on Tiptap that fills any app shell content area: formatting toolbar with shortcuts, link popover and bubble, highlight colors, shadcn task checkboxes, edit and view modes, live word count. For docs, briefs, notes.

- Type: Pro block
- Category: [Rich Text Editor](https://web.dev.reui.io/blocks/application/rich-text-editor.md)
- Page: https://web.dev.reui.io/blocks/application/rich-text-editor/rich-text-editor-1
- MCP: `get_block("rich-text-editor-1")`
- Built with: Alert Dialog, Avatar, Badge, Button, Button Group, Checkbox, Dropdown Menu, Field, Frame, Input Group, Kbd, Popover, Separator, Skeleton, Toggle, Tooltip
- Installs with a ReUI Pro or Ultimate license; setup: https://web.dev.reui.io/docs/license-setup

## Best for

A bounded Frame that scrolls its page inside, with a word, character and read time footer and a Keyboard Shortcuts popover

## Agent notes

- `DOCUMENT`, `DOCUMENT_META` and `COLLABORATORS` in data.ts are the demo launch brief, its title and the avatar stack to replace
- `onSave` receives the JSON once typing pauses for `SAVE_DELAY_MS`; without it the Saved label is a timer and nothing persists
- The root `Frame` scrolls the page inside itself, so its host needs a bounded height

## When not to use

- Slash commands, @ mentions and tables are needed inside the page: use [Wiki Page Editor](https://web.dev.reui.io/blocks/application/rich-text-editor/rich-text-editor-2.md) (`get_block("rich-text-editor-2")`)
- Each edit must be a tracked suggestion that a reviewer accepts or rejects: use [Contract Redlines](https://web.dev.reui.io/blocks/application/rich-text-editor/rich-text-editor-3.md) (`get_block("rich-text-editor-3")`)

## Third-party libraries

- Tiptap v3: [API reference](https://tiptap.dev/docs/editor/api/editor), [docs](https://tiptap.dev/docs/editor/getting-started/install/react), [llms.txt](https://tiptap.dev/llms.txt)
- Sonner v2: [API reference](https://sonner.emilkowal.ski/toast), [docs](https://sonner.emilkowal.ski/getting-started)

## Install

```bash
npx shadcn@latest add @reui/rich-text-editor-1
```

## About Rich Text Editor blocks

### When to use

- Documents written and kept inside a product: launch briefs, wiki pages, contracts, specs and plans
- Review on the text itself, through tracked suggestions to accept or reject or threaded comments
- Shared writing with live teammates, or with an AI assistant whose edits arrive for review

### When not to use

- The navigation layout around your pages, with no document editing in it: use the [App Shell blocks](https://web.dev.reui.io/blocks/application/app-shell.md)
- A top bar with a title, avatars and actions above a page you already have: use the [Navbar blocks](https://web.dev.reui.io/blocks/application/navbar.md)
- A strip of formatting or alignment controls alone, with no document under it: use [Button Group](https://web.dev.reui.io/components/button-group.md) (`get_component("button-group")`)

### Agent notes

- Each page.tsx wraps the root in an `h-svh` or `min-h-svh` column; inside an app shell drop it and size the root through `className`
- Every schema starts from `createRichTextExtensions` in rich-text-extensions.ts; extend that list and keep it stable, as `useEditor` compares it by identity
- Document typography is `RICH_TEXT_PROSE` in rich-text-content.tsx, built on theme tokens; restyle headings, lists, code and links there

Every ReUI item has a twin like this one; the index is https://web.dev.reui.io/llms.txt. Agents with the ReUI MCP (https://web.dev.reui.io/docs/mcp) get the same guidance from the getters named above.
