Recipes
Tasks solved with the Editor's public API. Each has a Live example you can try.
Each Recipe has one Live example — a code file: it runs on the page with the real kit and is shown
as source right next to it. Copy the code as is — just replace the acme_
Consumer prefix with your app's. Capitalized words (Block, Schema, Handle) are
Editor terms; their meanings are collected in the glossary.
Custom Blocks and Marks
Merge Tag
Field substitution in an email: an inline Atom and a Toolbar button with a popover.
Mentioning teammates
An @name Atom and a “/” item with a search popover.
Note
A container Block: a “/” item and Block actions in the “⋮” menu.
Comments on text
A custom Mark with attributes and a Text card with the comment.
Spoiler
A custom Block that comes alive in RichTextView thanks to an Island.
Markdown for a custom Block
A tokenizer, parsing and renderMarkdown: the Block makes a round trip through Markdown.
Insertion and “/” commands
Document templates
A document structure in one edit from “/”.
The “/ai” AI command
A prompt in a popover, the model's answer in one edit, progress via showNotice.
Image upload
onUploadImage: paste, drag and drop, failure.
Your own paste and drop handlers
A Tool without a Block: your own handlePaste and handleDrop.
Video: YouTube and Twitch
Built-in Tools: a link in the Document, a player drawn by the kit.
App integration
Your own toolbar outside the field
A formatting toolbar in the screen header on useRichTextEditorState.
Control via ref
Inserting a template at the caret, onReady and Markdown export.
Autosave and the Status bar
Saving on onBlur and “Saved” in the Status bar.
The Editor in a form
FormField, name for FormData and your own required check.
Review mode
readOnly with comment cards.
Server and performance
Server-side HTML sanitization
sanitizeRichText on save and RichTextView in a Next.js server component.
Lazy loading the engine
A custom Tool's Tiptap as a separate chunk: Skeleton, Readiness and “Retry”.
Theming
TypeScript types
Public types exported by the @olddevs/ui/editor entry point. The tables are built from the installed package's TypeScript declarations.
Merge Tag: inserting fields into an email
An inline Atom with a field key and a Toolbar button — on send, the server puts the customer's name in its place.