When to use
- Context — an aside that adds background without changing what the reader should do. Use Note.
- Shortcuts — a quicker or better way of doing the thing just described. Use Tip.
- Traps — where the obvious action costs the reader time or work. Use Warning.
- The irreversible — data loss, a broken release, a security consequence. Use Important, and sparingly: if everything is important, nothing is.
Key decisions
- Variant sets both the accent colour and the label, so most callouts need nothing else.
- Label replaces the variant name — for example "Measured" or "Deprecated". It is uppercased by CSS, so type it in sentence case.
- Length: a paragraph or two. A callout holding a page of text reads as body copy with a border.
- Content takes everything a Text block does: lists, tables, links and code. For inline code, apply Bold and Italic together.
Examples
Each callout below is the same block with a different Variant. The last one sets a custom Label.
The default. Use it for an aside that adds context without changing what the reader should do.
Use it for a shortcut, or a better way of doing the thing just described.
Use it where a reader can lose work or time by doing the obvious thing.
Reserved for the irreversible. Never add require-trusted-types-for to this site's CSP — it strips the header, footer, ISI and cookie banner.
Measured
A callout can hold anything a Text block can:
| Content | Supported |
|---|---|
| Lists and links | Yes |
| Tables | Yes |
| Code blocks | Yes |
npm run build:json
All authoring options
General
id: anchor id on the block, for linking straight to it (/page#my-anchor)
label: optional; falls back to the variant name
content: rich text — paragraphs, lists, tables, code blocks
Appearance
classes_calloutVariant: callout-note (Note, default) | callout-tip (Tip) | callout-warning (Warning) | callout-danger (Important)
Analytics
classes_track-inview: emit an event when the block scrolls into view
classes_track-link-click: emit an event when a link in the content is clicked
contentLinkMeta: one JSON object per content link
meta: block-level analytics meta, sent as a JSON string
Events emitted:
emu-callout:inview
emu-callout:inner-link:click