Block Reference
This page documents every block type the editor ships. Every block has a JSON shape, a renderer, and a programmatic insert path via editor.blocks.insert.
All blocks share the same envelope when serialised: id, type, data, and an optional tunes record.
The block shape
Every block serialises to the same JSON envelope. The id is assigned by the editor and can be omitted when constructing data programmatically.
{
"id": "abc123",
"type": "paragraph",
"data": { "html": "Hello <b>world</b>" },
"tunes": {}
}alert
Highlighted call-out box with 4 variants.
| Field | Type | Required | Description |
|---|---|---|---|
| html | string | Yes | HTML content of the alert message. Inline tool markup is supported. |
| variant | 'error' | 'info' | 'success' | 'warning' | Yes | Visual style of the alert. One of: error, info, success, warning. |
{
"type": "alert",
"data": { "html": "Your session will expire in 5 minutes.", "variant": "warning" }
}audio
Audio block. Consumed via the audioUploader callback on Editor.create.
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | URL of the audio file to embed. |
| caption | string | No | Plain-text caption displayed below the player. |
| alt | string | No | Accessible label for the audio element. |
| alignment | 'center' | 'left' | 'right' | No | Horizontal alignment of the player. One of: center, left, right. |
{
"type": "audio",
"data": { "url": "/media/podcast.mp3", "caption": "Episode 12", "alignment": "center" }
}checklist
Interactive checkbox list with per-item checked state.
| Field | Type | Required | Description |
|---|---|---|---|
| items | ChecklistItem[] | Yes | Array of checklist items, each with a text and checked state. |
| items[].text | string | Yes | HTML content of the item label. |
| items[].checked | boolean | Yes | Whether the checkbox is checked. |
{
"type": "checklist",
"data": {
"items": [
{ "text": "Install the package", "checked": true },
{ "text": "Mount the editor", "checked": false }
]
}
}code
Syntax-highlighted code block. 50 languages are supported, including typescript, python, rust, go, ruby, swift and kotlin.
| Field | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | The raw code string to display. |
| language | CodeLanguage | No | Syntax highlighting language. Defaults to typescript. |
| theme | CodeTheme | No | Editor colour theme. Defaults to github-dark. |
| showCopy | boolean | No | Show a copy button in the rendered output. |
| syncKey | string | No | Blocks sharing a key switch language together. |
| variants | CodeVariant[] | No | When non-empty, renders a tab strip of variants and is the authoritative source. |
{
"type": "code",
"data": { "code": "const x = 42;", "language": "typescript", "theme": "github-dark", "showCopy": true }
}collapsible
A collapsible section with a title and nested child blocks. Unknown child block types are preserved verbatim, so newer documents survive older renderers.
| Field | Type | Required | Description |
|---|---|---|---|
| html | string | Yes | Section title as inline HTML. |
| open | boolean | No | Whether the section renders expanded. |
| children | Block[] | No | Nested child blocks. |
{
"type": "collapsible",
"data": {
"html": "Details",
"open": true,
"children": [{ "type": "paragraph", "data": { "html": "Hidden until opened." } }]
}
}collection
Embeds a live collection view by id. The block stores only the collection identity; the server owns the shape and the data.
| Field | Type | Required | Description |
|---|---|---|---|
| collectionId | string | Yes | The embedded collection id. The only thing stored. |
{
"type": "collection",
"data": { "collectionId": "c-42" }
}columns
A multi-column layout of 2 to 4 columns, each holding its own list of child blocks.
| Field | Type | Required | Description |
|---|---|---|---|
| columns | Block[][] | Yes | The columns, each a list of child blocks. Two to four columns. |
{
"type": "columns",
"data": {
"columns": [
[{ "type": "paragraph", "data": { "html": "Left" } }],
[{ "type": "paragraph", "data": { "html": "Right" } }]
]
}
}date
A calendar date, stored timezone-free so every collaborator agrees on it.
| Field | Type | Required | Description |
|---|---|---|---|
| date | string | Yes | ISO date in yyyy-MM-dd form, timezone-free. |
{
"type": "date",
"data": { "date": "2026-08-31" }
}delimiter
Visual separator between sections.
| Field | Type | Required | Description |
|---|---|---|---|
| variant | 'line' | 'stars' | Yes | Visual style of the divider. One of: line, stars. |
{
"type": "delimiter",
"data": { "variant": "line" }
}doc_card
A rich link card for another document. It stores the referenced page id plus a display snapshot that hosts refresh on rename.
| Field | Type | Required | Description |
|---|---|---|---|
| pageId | string | Yes | The referenced page id; the card identity. |
| title | string | Yes | Display snapshot of the page title. |
| icon | string | No | Optional icon shown on the card. |
| description | string | No | Optional description shown under the title. |
{
"type": "doc_card",
"data": { "pageId": "p-7", "title": "Release notes", "icon": "📄" }
}embed
An embedded link. The block stores the URL; the provider and embed markup are derived at render time, with unfurl fields as the fallback card.
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | The embedded link. Provider and embed markup are derived from it at render time. |
| title | string | No | Unfurl snapshot for the link card. |
| description | string | No | Unfurl description for the link card. |
| imageUrl | string | No | Unfurl preview image for the link card. |
{
"type": "embed",
"data": { "url": "https://www.youtube.com/watch?v=abc123" }
}file
A file attachment with a download link, a name, and optional size and content type.
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | Where the file is served from. |
| name | string | Yes | File name shown on the attachment. |
| size | number | No | File size in bytes. |
| contentType | string | No | MIME type of the file. |
{
"type": "file",
"data": { "url": "/files/notes.pdf", "name": "notes.pdf", "size": 2048, "contentType": "application/pdf" }
}glance
A label and value summary panel: rows of facts read at a glance, with an optional caption and background variant.
| Field | Type | Required | Description |
|---|---|---|---|
| rows | GlanceRow[] | Yes | The facts to show: each row is a label and an inline HTML value. |
| caption | string | No | Optional caption above the rows. |
| variant | 'plain' | 'error' | 'info' | 'success' | 'warning' | No | Background variant; plain is unstyled, the rest match the alert palette. |
{
"type": "glance",
"data": {
"caption": "Facts",
"rows": [{ "label": "Version", "html": "<b>1.0</b>" }],
"variant": "plain"
}
}header
Top-level and section headings (h1 to h6). Inline tools work inside the html payload.
| Field | Type | Required | Description |
|---|---|---|---|
| html | string | Yes | HTML content of the heading. Inline tool markup is supported. |
| level | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | No | Heading level. One of: h1, h2, h3, h4, h5, h6. Defaults to h1. |
{
"type": "header",
"data": { "html": "Getting started", "level": "h2" }
}image
Image block with caption and alt text. Consumed via the imageUploader callback on Editor.create.
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | URL of the image to embed. |
| caption | string | No | Plain-text caption displayed below the image. |
| alt | string | No | Alt text for the image element. |
| alignment | 'center' | 'left' | 'right' | No | Horizontal alignment of the image. One of: center, left, right. |
{
"type": "image",
"data": { "url": "/img/hero.jpg", "caption": "Hero image", "alt": "A hero", "alignment": "center" }
}latex
LaTeX math, stored as source and typeset at render time. A better renderer later improves every document that already exists.
| Field | Type | Required | Description |
|---|---|---|---|
| source | string | Yes | The LaTeX source. Stored as source, never as rendered output. |
{
"type": "latex",
"data": { "source": "\\frac{a}{b}" }
}list
Ordered or unordered list. Each item is html.
| Field | Type | Required | Description |
|---|---|---|---|
| type | 'ordered' | 'unordered' | Yes | List type. One of: ordered, unordered. |
| items | string[] | Yes | Array of HTML strings, one per list item. |
{
"type": "list",
"data": { "type": "unordered", "items": ["First item", "Second item"] }
}mermaid
A Mermaid diagram, stored as source and drawn at display time, never as a raster.
| Field | Type | Required | Description |
|---|---|---|---|
| source | string | Yes | The Mermaid source. Stored as source, never as drawn output. |
{
"type": "mermaid",
"data": { "source": "flowchart TD\n A --> B" }
}openapi
Renders an interactive API reference from an OpenAPI 3.x document, inline or fetched from a URL, with server pickers and code snippets.
| Field | Type | Required | Description |
|---|---|---|---|
| spec | object | No | An inline OpenAPI 3.x document. Wins over url when both are set. |
| url | string | No | Where to fetch the OpenAPI document from at render time. |
| include | OpenApiFilter | No | Filter for which operations to render. |
| exclude | OpenApiFilter | No | Filter for which operations to hide. |
| defaultServer | string | No | Which server the reference selects by default. |
| snippetLanguages | CodeLanguage[] | No | Languages offered for request snippets. |
{
"type": "openapi",
"data": { "url": "/api/openapi.json", "defaultServer": "https://api.example.com" }
}paragraph
Rich-text paragraph. Accepts inline tool markup such as bold, italic, code, link, marker, and tooltip.
| Field | Type | Required | Description |
|---|---|---|---|
| html | string | Yes | HTML content of the paragraph. Inline tool markup is supported. |
{
"type": "paragraph",
"data": { "html": "This is a <b>paragraph</b> with inline markup." }
}quote
Blockquote with an optional author attribution.
| Field | Type | Required | Description |
|---|---|---|---|
| html | string | Yes | HTML content of the quote body. Inline tool markup is supported. |
| author | string | No | Plain-text or HTML attribution shown beneath the quote. |
{
"type": "quote",
"data": { "html": "The best way to predict the future is to invent it.", "author": "Alan Kay" }
}sketch
A freehand drawing stored as strokes, never a raster, so it stays editable and scales cleanly.
| Field | Type | Required | Description |
|---|---|---|---|
| strokes | SketchStroke[] | Yes | The drawing as strokes: each stroke is a list of points with optional color and width. |
{
"type": "sketch",
"data": { "strokes": [{ "points": [0, 0, 10, 10], "color": "#ff0000", "width": 3 }] }
}table
Data grid. First row can be used as a header; each cell is html.
| Field | Type | Required | Description |
|---|---|---|---|
| data | string[][] | Yes | Two-dimensional array of HTML cell strings. The first row is the header row. |
| caption | string | No | Plain-text or HTML caption displayed below the table. |
| showDownload | boolean | No | Show a download button in the rendered output. |
{
"type": "table",
"data": {
"data": [["Name", "Type"], ["html", "string"], ["variant", "AlertVariant"]],
"caption": "AlertData fields",
"showDownload": false
}
}toc
A table of contents derived from the document headers at render time. It stores no data of its own.
This block stores no fields; the list is derived from the document headers at render time.
{
"type": "toc",
"data": {}
}updates
A live activity feed for a document. It stores identity, never a snapshot, so it keeps showing current activity.
| Field | Type | Required | Description |
|---|---|---|---|
| pageId | string | No | Which document activity to show. Absent means the document the block sits in. |
{
"type": "updates",
"data": { "pageId": "p-7" }
}video
Video block. Consumed via the videoUploader callback on Editor.create.
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | URL of the video file or YouTube/Vimeo embed link. |
| caption | string | No | Plain-text caption displayed below the player. |
| alt | string | No | Accessible label for the video element. |
| alignment | 'center' | 'left' | 'right' | No | Horizontal alignment of the player. One of: center, left, right. |
{
"type": "video",
"data": { "url": "/media/demo.mp4", "caption": "Product demo", "alignment": "center" }
}