Block Reference
Clepit ships 12 built-in block types. 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. |
{
"type": "code",
"data": { "code": "const x = 42;", "language": "typescript", "theme": "github-dark", "showCopy": true }
}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" }
}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" }
}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"] }
}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" }
}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
}
}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" }
}