# AI Writing Assistant block

> Tiptap AI Document Assistant With Streamed Suggestions, Step Trace and Review Dock

Agentic document editor on Tiptap: a floating assistant dock runs tasks on the page or a selection, streams its edits in as tracked suggestions with a live cursor, shows each step, then steps through accept or reject. For AI writing, docs, plans.

- 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-5
- MCP: `get_block("rich-text-editor-5")`
- Built with: Avatar, Badge, Button, Button Group, Checkbox, Dropdown Menu, Field, Frame, Icon Tile, Input Group, Item, Kbd, Marker, Popover, Select, Separator, Skeleton, Spinner, Toggle, Tooltip
- Installs with a ReUI Pro or Ultimate license; setup: https://web.dev.reui.io/docs/license-setup

## Best for

An agent dock that maps typed asks to tasks by keyword, streams Edit and Add tasks as tracked edits and answers Review with findings

## Agent notes

- `planAction` plans each task with canned rules and no model call; swap it for your model's tool calls that return an `AssistPlan`
- `ASSIST_REWRITES`, `ASSIST_MISSPELLINGS`, `ASSIST_SUMMARY` and `ASSIST_CHECKLIST` hold the canned text the tasks write; replace them with real output
- `DOCUMENT` ships with seeded suggestions, so the dock opens on a review; pass `content` to open your own document

## When not to use

- A plain writing surface with formatting tools and no assistant dock: use [Document Editor](https://web.dev.reui.io/blocks/application/rich-text-editor/rich-text-editor-1.md) (`get_block("rich-text-editor-1")`)
- Human edits that must be tracked as suggestions for a reviewer to accept or reject: 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)
- Motion v12: [API reference](https://motion.dev/docs/react-motion-component), [docs](https://motion.dev/docs/react) (the docs follow the latest Motion, with no React API break since v12)
- 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-5
```

## 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.
