Skip to content

Block types

phil/ujo

Every type of UJO (Universal JSON Output) is named at the same level as those of the Editor.js tools, in camel case, without prefix. "Also read" lists the other names and forms a type accepts; they are written back in the canonical form. Values left out take the default shown, or stay out when there is none. HTML values are sanitized with the rich profile unless said otherwise (inline-html.md); plain values are kept as they are and escaped when rendered.

Official tools — StandardTypes

TypeDataAlso read
paragraphtext htmlalignment in the data, moved to the alignment tune
headertext html; level 1–6, default 2alignment and anchor in the data, moved to their tunes
liststyle unordered, ordered or checklist; meta {start ≥ 0, counterType}; items [{content html, meta {checked}, items […]}]list 1.x, items as texts; the checklist tool, {items: [{text, checked}]}; the nested checklist, items with checked
quotetext html; caption html, default ""; alignment left or center, default left
warningtitle html; message html; both default ""
delimiteroptionally style star, dash or line; lineWidth 1–100; lineThickness 1–20
codecode plain; optionally language, up to 32 of A-Za-z0-9_+#.-showlinenumbers of CodeFlask, dropped
rawhtml, sanitized with the raw profilenot in the default registry
tablewithHeadings, stretched, default false; content rows of cells, every row as wide as the first; in the rich form, a cell is {text html, colspan 1–100, rowspan 1–1 000, header, align left, center or right}, a cell spanning rows covering the columns below it, and the table has optionally a caption html and align, the alignment of each column, "" for none
imagefile {url, …}, keeping what the server added; caption html; optionally alt, plain, up to 1 000 characters, the alternative text when it differs from the caption; withBorder, withBackground, stretched, default false; optionally unsplash {author, profileLink}the simple image's url, moved into file
linkToollink, http or https; meta {title, site_name, description, image {url}}, keeping what the server addedlink
attachesfile {url, size, name, extension}, keeping what the server added; title plain, default ""
embedservice; source, http or https; embed, https on a host of the service; optionally width, height 1–10 000; caption html; optionally poster, title plain up to 200 characters and qrCode, what paper shows in place of the frame
personalityname plain; description plain, default ""; optionally link, http or https, and photo

An address is http, https or relative, never protocol-relative, unless the table says otherwise. The embed services are those of the Editor.js embed tool, each with the hosts of its frames; EmbedServices::with() adds one, and StandardTypes::all($services) or StandardTypes::embed($services) takes the result.

Community tools — CommunityTypes

TypeDataAlso read
alerttype info, primary, secondary, success, warning, danger, light or dark, default info; align left, center or right, default left; text htmlmessage, as text
toggletext html; open, default false; blocksthe toggle block, {text, status, fk, items}, and the collapsible block accordion, {title, settings {blockCount, defaultExpanded}}: the items or blockCount blocks after them are folded inside
columnscols, 1 to 6 of {blocks}the calumk columns, each a whole document {time, blocks, version}
mathlatex plain, up to 20 000 characters, or mathml, one <math> element of MathML Core kept as the mathml profile allows, or both; optionally renderedthe LaTeX block Math, {math}
mermaidcode plain, up to 20 000 characters; caption html; optionally rendered
charta Chart.js configuration, kept as it is; rendered checked when present
buttonlink; text plainAnyButton
galleryfiles, at least one {url, caption}, keeping what the server added; optionally source; style fit or slider, default fitthe carousel, a list of {url, caption}, as a slider

rendered, of StoredMarkup::property(), is the drawing a server keeps beside the source: {"markup": svg or mathml, "key": text}, the markup at most 1 MiB, the key 1 to 256 letters, digits and ._~-. The normalizer checks only its shape: the markup is written in a page only once HtmlRenderer::withStoredMarkup() has proved its key — see HTML rendering. phil/svg-blocks writes it.

Players — MediaTypes

TypeData
videosources, 1 to 8 {url, type} in the order a player tries them, type a media type such as video/webm; codecs="vp9"; tracks, up to 16 {url, kind, language, label, default}, kind captions, subtitles, descriptions, chapters or metadata, default subtitles, language a BCP 47 tag; controls, default true; loop, muted, default false; optionally poster, width, height 1–10 000 and title; caption html; optionally qrCode
audiothe same, without poster, width and height

A source may be a file of the media library, by its address. On paper, a player shows its poster, its title and its first source's address, and a QR code of that address when qrCode is true.

The layout tool of editorjs-layout is not read: its containers carry free CSS, which no type here accepts. A site that needs it registers its own type.

Page and game types — LayoutTypes

TypeData
pageBreak, columnBreaknone
pageStyleoptionally variant frontCover, insideCover, partCover or backCover; classes, names, default []
wideblocks, spanning every column of the page
columnFlowcount 2–6, default 2; blocks, flowing in columns
spacerlines 1–50, default 1
pageNumbermode auto, fixed, skip or reset, default auto; optionally value, up to 16 characters
runningFootertext html: the label at the foot of the pages that follow
footnoteid, a name; text html: the note <sup data-footnote="id"> refers to
toctitle plain; depth 1–6, default 3; wide, default false: generated from the headings when rendered; at most ten per document
indextitle plain; columns 1–6, default 2; entries [{term, pages, children […]}]
abbreviationstitle plain: generated when rendered, each <abbr title> of the document once, with the first meaning it is given, in alphabetical order; at most ten per document
watermarktext plain, up to 100 characters
note, descriptivetitle html, default ""; blocks: a boxed note, read-aloud text
statblockkind monster, spell, item or other; name; subtitle html; frame, wide; sections [{title, properties [{label, value html}], abilities [{label, score, modifier}], blocks}]; optionally record, the game data it is bound to, or null
definitionListitems, at least one {term html, definitions [html, …]} with at least one definition
credittitle plain; text html
bannertext plain, up to 100 characters
decorationkind stain or ornament; variant 1–99; optionally color #rrggbb
qrCodedata, 1 to 2 048 characters; optionally rendered
containerclasses, at least one name the look declares; blocks

A stat block holds no game system: its labels and values are the writer's.

Tunes — Tunes

TuneValueAlso read
alignment{alignment: left, center, right or justify}alignmentTune
anchor{anchor}, a letter then up to 63 of A-Za-z0-9_-anchorTune
textVariant"", call-out, citation or details
notice{style: info, warning or spoiler, caption}noticeTune
indent{indentLevel: 0–8}indentTune
layout{position: absolute or relative, top, right, bottom, left, width, height, wrap: left or right, zIndex: -10–100}, lengths as 20px, -3cm, 1.5em, 50%, 0 or auto
mask{shape: center, edge or corner, variant 1–99, offsetX, offsetY: percentages, rotation: -360–360}
toc{include}: whether a heading enters the table of contents
variant{name, frame, decoration}: a variant the look declares
language{language, direction}: a BCP 47 tag and, optionally, ltr, rtl or auto, for a block in another language than the document
dataup to 32 texts of up to 1 000 characters, under names [a-z][a-z0-9-]* of up to 64 characters: the data-* values of the block, which a site binds to its own fields
note{text}, up to 10 000 characters: the writer's note on the block, never published