Media & components
The blocks that carry the hard parts of a page — optional depth, definitions, diagrams, images and video.
Collapsible sections
Wrap optional depth in a disclosure. It uses the native <details> element, so it is keyboard accessible and prints expanded.
Rotating an API key without downtime
Create the second key, deploy it to every client, confirm traffic on the new key in the dashboard, then revoke the first. Both keys stay valid until you revoke, so there is no cutover window.
Full list of retry status codes
408, 429, and any 5xx are retried with exponential backoff. 4xx other than 408 and 429 are treated as permanent failures.
Never hide the answer in one
Collapsed text is invisible to browser find (⌘F) and to some third-party crawlers. Use disclosures for optional depth and long output — never for the sentence the reader came for.
Tabs with mixed content
When each choice needs more than one code sample, such as an explanation, a callout or a second command, use tabs whose panels hold any content, including other components.
Sample content
The @stratus/sdk package and the Yarn tab are here to show the component. Stratus itself installs with npm only.
Definition lists
For glossaries and field-by-field terminology, where a table would be three columns of nothing.
- Idempotency key
- A client-generated string that makes a retried request safe. Keys are remembered for 24 hours.
- Dead letter
- Where an event lands after its final delivery attempt fails. Replayable from the dashboard for 30 days.
- Soft descriptor
- The text your customer sees on their bank statement. Up to 22 characters.
Text-based diagrams
Diagrams are written as Mermaid text, so they diff in review and whoever inherits the page can edit them without opening a design tool.
flowchart LR
A[Event] --> B{Retry?}
B -- yes --> C[Queue]
B -- no --> D[Dead letter]Diagrams render in the browser
Mermaid needs a DOM to lay a diagram out, so the source ships in the page and the SVG replaces it once the library loads — only on pages that contain a diagram. With JavaScript off, and on paper, the reader gets the source instead of an empty box.
Images
Alt text is required. Captions are optional, light and dark variants are a pair, and on desktop any image can be clicked to zoom.
Light and dark variants
Pass alternateSource and the template swaps it with the color mode — no flash, no duplicated Markdown. Screenshots of your own UI stop looking broken in dark mode.
Video
Local files or a YouTube or Vimeo embed. Videos are lazy-loaded, never autoplay with sound, and want a caption track for anything instructional.
From YouTube or Vimeo
An embed takes the video’s ID, not its URL — the part after v= on YouTube, or the number on Vimeo.
<Video
type="youtube"
videoId="fxWuYi5jPkA"
title="Build your editing experience locally with the CloudCannon dev server"
/>From a file
Put the file under public/videos/ and pass its path from public/. Upload a .webm with the same name beside the .mp4 and both are offered to the browser, which plays the first it supports.
<Video
type="local-source"
source="/videos/glass.mp4"
title="Glass"
/>Status badges
A badge marks the maturity of the thing next to it — a feature, an endpoint, a whole page. Put it above the prose it qualifies, so a reader who skims the headings still sees it.
BetaBadges also sit inside a sentence: the /webhooks/retries endpoint Beta is the one place this matters. That is the only component that works inline — everything else in the library is a block.
Badges link, too: pass link and the badge becomes an anchor with a trailing arrow, which is how a deprecation notice points at its replacement.
Dot instead of an icon
showDot swaps the leading icon for a small status-colored dot. It reads as a state rather than a category, which suits Stable / Beta / Deprecated better than an icon does.
Third-party embeds
Embed carries raw HTML — a sandbox, a map, a form from another service. Whatever you put inside it is scaled to the aspect ratio you pick, so the page reflows without a jump while the frame loads.
An embed is somebody else's page
It loads in the reader's browser, so it carries that provider's cookies and can't be indexed by search. It also prints as an empty box — keep anything essential in the prose around it, not only inside the frame.