Not every diagram is a network of boxes. When the content is a conversation between parties, dates on a line, a stack, a loop or a hierarchy, the kit has a form for it that lays itself out. This page shows you when to use each of the five, which parts go inside it and how it builds by step. Each one goes in the diagram layout and needs a title prop, as a <Flow> does; for boxes and arrows, and for <Edge>, <Packet>, <State> and <Focus>, see Flow diagrams.
Sequence diagram
Use <SequenceDiagram> for who calls whom, in order: a protocol, an API handshake, a retry.
<Actor>goes inside<SequenceDiagram>: one per party, drawn as a node over its lifeline, withid,title,subtitle,kind,iconandcardas on a node.<Message>goes inside<SequenceDiagram>, after the actors, in order from top to bottom:fromandto(the same actor for a call to itself),label,replyfor a response (a dashed arrow) andasyncfor fire-and-forget (a dashed arrow).
Each message takes at, the step that reveals it, and its arrow animates while that step is current. This one adds a message per step:
The self-call on step 5 here is the point of the slide:
---
layout: diagram
title: An idempotency key makes a double click charge once
eyebrow: Sequence
budget: 1m30s
---
<SequenceDiagram title="A double-clicked payment, charged once thanks to its idempotency key">
<Actor id="shopper" kind="user" title="Shopper" />
<Actor id="web" kind="client" title="Web app" />
<Actor id="payments" kind="service" title="Payments API" />
<Actor id="ledger" kind="database" title="Ledger" />
<Message from="shopper" to="web" label="Clicks Pay twice" at={1} />
<Message from="web" to="payments" label="POST /charges, key k-71" at={2} />
<Message from="payments" to="ledger" label="Insert k-71" at={3} />
<Message from="web" to="payments" label="Same key again" at={4} />
<Message from="payments" to="payments" label="k-71 seen: reuse result" at={5} />
<Message from="payments" to="web" label="201, one charge" reply at={6} />
</SequenceDiagram>
<Notes>
The second POST carries the same key, so the API finds the first result and returns it instead of charging again. Pause on step five: that self-call is the whole trick.
</Notes>Slide 7 of the diagrams-demo deckView on GitHub
Message labels sit above their arrows on one line, so keep them short.
Timeline
Use <Timeline> for milestones in time order with where you are now: a roadmap, a migration, a history.
<Milestone>goes inside<Timeline>, in time order:dateas it should read (Q1 2026),title, a short line of detail as its children, and optionallystate(successfor done, as below) andicon.
Each milestone takes at. The line fills up to the latest milestone shown, or to the one marked current, which stays current once revealed while later milestones appear:

<Milestone date="Q3 2026" title="Region cells" at={3} current>EU and US apart</Milestone>The timeline layout draws the same <Timeline> from frontmatter: three to five milestones: with date, title, detail and state, a current: milestone number and reveal: true for one milestone per click. Use the layout when the timeline is the whole slide and fits its limits; use the component in the diagram layout when you want an <Aside> beside it or six milestones. The layout’s fields are on its page.
Layers
Use <Layers> for a stacked architecture or an ownership map: bands from top to bottom, each with its building blocks.
<Layer>goes inside<Layers>, top to bottom:title,subtitle(what it does or who owns it),at,stateandcard.<Item>goes inside<Layer>only: a chip withtitle,kind(for its icon),icon,stateandcard.
Give each layer an at to build the stack band by band. While the stack builds, the band each step adds is picked out; once the last band is in, only bands with a state stand out, so mark the band the slide is about with state="highlighted".

Cycle
Use <Cycle> for a loop of stages that repeats: an incident loop, a feedback cycle, an agent loop.
<Node>goes inside<Cycle>: one per stage, in order from the top.<Edge>between two consecutive stages labels or styles that arc;<State>,<Packet>and<Focus>work as in a<Flow>.
steps walks the loop one stage per step; spin keeps a packet circling while the slide is on screen.

<Cycle title="The incident loop: detect, respond, recover, learn" steps>
<Node id="detect" kind="service" title="Detect" subtitle="Alerts and SLOs" />
<Node id="respond" kind="user" title="Respond" subtitle="On-call engineer" />
<Node id="recover" kind="function" title="Recover" subtitle="Roll back or fail over" />
<Node id="learn" kind="document" title="Learn" subtitle="Blameless review" />
</Cycle>Tree
Use <Tree> for a hierarchy: an org chart, a decision tree, a module tree.
- One root
<Node>goes inside<Tree>, and every child<Node>is nested inside its parent.
direction is down (the default) or right. at on a node reveals its branch:

<Node id="weight" kind="node" icon="package" title="Weight" subtitle="Surcharge" at={2}>
<Node id="light" title="Under 2 kg" subtitle="+€0" at={2} />
<Node id="heavy" title="Over 2 kg" subtitle="+€1.50" at={2} />
</Node>Cards
Four of the five forms take card, the node style a brand defines, as a <Flow> does: put it on one part, or on the diagram for all its parts, and a part’s own card wins. Choosing a card, the order a node follows and the standard names are on flow diagrams.
| Form | Takes card |
|---|---|
<SequenceDiagram> |
On <Actor>, or on the diagram for every actor. |
<Layers> |
On <Item>, on <Layer> for its band, and on <Layers> for every item. |
<Cycle> |
On each stage’s <Node>, or on the cycle. |
<Tree> |
On each <Node>, or on the tree. |
<Timeline> |
No: milestones take no card. |
On <Layers> the bands keep the stack’s own look, a tint with a bold left edge, unless a <Layer> names a card; the stack’s card styles only the item chips. Here the item chips are outlines, the services band is on tint and Payments is on solid:
<Layers title="The platform in three layers, with the services layer and the payments service marked" card="outline">
<Layer title="Edge" subtitle="Platform team">
<Item kind="cloud" title="CDN" />
<Item kind="gateway" title="API gateway" />
</Layer>
<Layer title="Services" subtitle="Domain teams" card="tint">
<Item kind="service" title="Orders" />
<Item kind="service" title="Payments" card="solid" />
<Item kind="service" title="Routing" />
</Layer>
<Layer title="Data" subtitle="Data team">
<Item kind="database" title="Postgres" />
<Item kind="queue" title="Kafka" />
</Layer>
</Layers>Limits
deck diagrams gives each form these limits. They are guidance for one slide: a sequence of seven actors and a tree of 13 nodes both lint without a finding. Past them, split the diagram over two slides.
| Form | Limits |
|---|---|
<SequenceDiagram> |
6 actors, 10 messages |
<Timeline> |
6 milestones |
<Layers> |
6 layers, 6 items per layer |
<Cycle> |
8 stages |
<Tree> |
12 nodes, 7 leaves, depth 4 |
Every prop of every part is on the diagram reference.







