TipTap-based rich text editor with embedded media, callouts, tables, code blocks, inline AI proofreading, and more.
Overview
Every richtext field uses a built-in TipTap v3 editor with full media embedding, structured content nodes, and AI assistance.
Embedded media types
| Node | Description |
|---|---|
| Image | Upload or paste. Supports resize handles and alignment. |
| Video embed | YouTube or Vimeo URL → responsive iframe. |
| Audio embed | Upload mp3/wav/ogg → inline <audio> player. |
| File attachment | Upload any file → download-link card. |
| Callout | Styled info/warning/tip/danger box with editable text. |
| Table | Structured data table with header row, context toolbar. |
| Code block | Fenced code block with syntax highlighting. |
| Interactive embed | Embed an Interactive from the Interactives manager. |
Controlling available features
Use the features array to control which toolbar items are shown:
// Full-featured (default — all tools available)
{ name: 'content', type: 'richtext' }
// Restricted — only basic formatting + images
{
name: 'content',
type: 'richtext',
features: ['bold', 'italic', 'heading', 'link', 'image', 'bulletList', 'orderedList']
}
// Minimal — text only, no media
{
name: 'bio',
type: 'richtext',
features: ['bold', 'italic', 'link']
}All available features
| Feature | Toolbar item | Shortcut |
|---|---|---|
bold | Bold text | Cmd+B |
italic | Italic text | Cmd+I |
underline | Underline | Cmd+U |
strike | Strikethrough | Cmd+Shift+S |
code | Inline code | |
superscript | Superscript (x²) | Cmd+. |
subscript | Subscript (x₂) | Cmd+, |
heading | Heading selector (H1-H3) | |
bulletList | Bullet list | |
orderedList | Numbered list | |
blockquote | Blockquote | |
horizontalRule | Horizontal line | |
textAlign | Text alignment | |
highlight | Highlight with color picker | |
link | Hyperlink | Cmd+K |
table | Data table | |
image | Image upload/embed | |
video | Video embed | |
audio | Audio file upload | |
file | File attachment | |
callout | Info/warning/tip callout | |
interactive | Interactive embed |
Markdown storage
Richtext fields store markdown. Standard formatting uses native markdown syntax. Features that markdown doesn't support use inline HTML:
| Feature | Stored as | ||
|---|---|---|---|
| Underline | <u>text</u> | ||
| Superscript | <sup>text</sup> | ||
| Subscript | <sub>text</sub> | ||
| Highlight | <mark style="background-color:#fde68a">text</mark> | ||
| Text alignment | <p style="text-align:center">text</p> | ||
| Interactive embed | `!!INTERACTIVE[id | title | align:left]` |
Rendering in Next.js
Use react-markdown with remark-gfm:
import ReactMarkdown from 'react-markdown';
import remarkGfm from 'remark-gfm';
function ArticleBody({ content }: { content: string }) {
return (
<ReactMarkdown remarkPlugins={[remarkGfm]}>
{content}
</ReactMarkdown>
);
}Never use
dangerouslySetInnerHTMLwith a regex-based parser — it breaks images with sizing, tables, and embedded media.
Inline Proofreading
The richtext editor has built-in AI proofreading that shows corrections directly inline — no toast notifications or popups.
How it works
- Click the Proofread button in the toolbar (or use the AI menu)
- The AI scans your text and returns corrections with character offsets
- Errors appear as red underlined text (spelling mistakes, grammar issues)
- Suggestions appear as green inline widgets (style improvements, word choice)
Correction toolbar
A sticky toolbar appears at the bottom of the editor showing:
- Navigation — ← 1/9 → to step through corrections one by one
- Accept / Reject — apply or dismiss the current correction
- Accept All / Reject All — batch-apply or dismiss all corrections at once
Navigating highlights the current correction in the editor so you can see the context.
Technical details
- Corrections are rendered as ProseMirror Decorations — they don't modify your content until you accept them
- The API returns character offsets; the editor maps these to ProseMirror positions
- Server-side validation fallback ensures offsets are correct even if the AI response is slightly off
- Language is auto-detected — no configuration needed
AI features
- AI Proofread — inline corrections with navigation toolbar (see above)
- AI Bubble Menu — select text for rewrite options (shorter, longer, formal, casual, translate)
- Zoom — scale editor content 50%-200%