---
title: "Diagrams"
description: "Every diagram type and its props."
---

> Documentation Index
> Fetch the complete documentation index at: https://sandrinodm.github.io/deckster/llms.txt
> Use this file to discover all available pages before exploring further.

# Diagrams

Use this page to look up the props of a diagram component or one of the parts that goes inside it, and the node kinds, states, edge options and cards a `<Flow>` takes. To learn how to draw one, start at [flow diagrams](https://sandrinodm.github.io/deckster/data-and-diagrams/flow-diagrams/), [sequence, timeline, layers, cycle and tree](https://sandrinodm.github.io/deckster/data-and-diagrams/sequence-timeline-layers-cycle-tree/) or [SVG](https://sandrinodm.github.io/deckster/data-and-diagrams/svg/).

For alignment, sizing, and styling, see [diagram design controls](https://sandrinodm.github.io/deckster/data-and-diagrams/diagram-design/).

- [`<Flow>`](https://sandrinodm.github.io/deckster/reference/diagrams/#props-Flow): Any system of boxes and arrows: an architecture, a request path, a pipeline. Place nodes with col/row (spans for wide nodes) or leave cells out for an automatic layout (`layout`, `direction`).
- [`<SequenceDiagram>`](https://sandrinodm.github.io/deckster/reference/diagrams/#props-SequenceDiagram): Who calls whom, in order: a protocol, an API handshake, a retry. `<Actor>`s across the top, `<Message>`s top to bottom; the current message animates.
- [`<Timeline>`](https://sandrinodm.github.io/deckster/reference/diagrams/#props-Timeline): Milestones in time order, with where we are now: a roadmap, a migration, a history. The line fills up to the latest milestone shown, or the one marked `current`.
- [`<Layers>`](https://sandrinodm.github.io/deckster/reference/diagrams/#props-Layers): A stacked architecture or ownership map: `<Layer>` bands top to bottom, each with `<Item>` chips.
- [`<Cycle>`](https://sandrinodm.github.io/deckster/reference/diagrams/#props-Cycle): A loop of stages that repeats: an incident loop, a feedback cycle, an agent loop. `steps` walks it one stage per step; `spin` keeps a packet circling; an `<Edge>` between consecutive stages labels that arc.
- [`<Tree>`](https://sandrinodm.github.io/deckster/reference/diagrams/#props-Tree): A hierarchy: an org chart, a decision tree, a module tree. Nest `<Node>`s; `direction` down or right; `at` on a node reveals its branch.
- [`<Svg>`](https://sandrinodm.github.io/deckster/reference/diagrams/#props-Svg): A drawing someone made (a floor plan, a product sketch, an exported figure): inlined and cleaned at build time (no scripts, event handlers or external references), it takes brand colors (`recolor`, or data-fill/data-stroke on shapes), reveals elements by id per step (`steps`) and can draw its strokes on (`draw`).
- [`<Node>`](https://sandrinodm.github.io/deckster/reference/diagrams/#props-Node): A box in a `<Flow>`, `<Tree>` or `<Cycle>`. `kind` sets its shape and icon; `icon` overrides it ("none" drops it).
- [`<Group>`](https://sandrinodm.github.io/deckster/reference/diagrams/#props-Group): A labelled container (a VPC, a region, "Client side"): nest the nodes in it; it wraps them, or takes its own col/row/colSpan/rowSpan.
- [`<Edge>`](https://sandrinodm.github.io/deckster/reference/diagrams/#props-Edge): A connection between two nodes; `to` equal to `from` draws a small loop on the node (a retry). In a `<Cycle>`, an `<Edge>` between consecutive stages labels or styles that arc.
- [`<Packet>`](https://sandrinodm.github.io/deckster/reference/diagrams/#props-Packet): Traffic along edges on a step: `from`/`to` or a multi-hop `path`, `at` (plays while that step is current) and `until` (to keep playing), `reply` for out, pause and back. Loops by default; `play="once"` rests at the end. from = to rides a self loop.
- [`<Journey>`](https://sandrinodm.github.io/deckster/reference/diagrams/#props-Journey): A request travelling hop by hop, one hop per step: `path` with `back` for the response, or `<Hop>` children with their own labels and replies; `focus` dims everything off the path; travelled edges stay lit (`trail`); `pace="trip"` plays the whole path on one step.
- [`<Hop>`](https://sandrinodm.github.io/deckster/reference/diagrams/#props-Hop): One hop of a `<Journey>`, with its own tag and reply.
- [`<State>`](https://sandrinodm.github.io/deckster/reference/diagrams/#props-State): Change a node or an edge from a step on: is="highlighted", "error", "success", "muted" or "default", with a `badge`.
- [`<Focus>`](https://sandrinodm.github.io/deckster/reference/diagrams/#props-Focus): Dim everything but some nodes (and the edges between them) for a range of steps.
- [`<Actor>`](https://sandrinodm.github.io/deckster/reference/diagrams/#props-Actor): A participant of a `<SequenceDiagram>`, drawn as a node over its lifeline.
- [`<Message>`](https://sandrinodm.github.io/deckster/reference/diagrams/#props-Message): An arrow between lifelines; `reply` for a response, `async` for fire-and-forget, from = to for a call to itself.
- [`<Milestone>`](https://sandrinodm.github.io/deckster/reference/diagrams/#props-Milestone): One milestone of a `<Timeline>`: date, title and a short line of detail as children.
- [`<Layer>`](https://sandrinodm.github.io/deckster/reference/diagrams/#props-Layer): One band of a `<Layers>` stack. While the stack is built, the band its `at` step adds is picked out; once the last band is in, only bands with `state` stand out, so mark the band the stack is about with `state="highlighted"`.
- [`<Item>`](https://sandrinodm.github.io/deckster/reference/diagrams/#props-Item): One building block in a `<Layer>`, as a chip with its kind’s icon.

## Diagrams and parts

Seven components are diagrams: you put one on a slide. The other thirteen are parts, and each part's entry says where it goes ("Goes in"): a `<Node>` in a `<Flow>`, a `<Group>`, a `<Cycle>` or nested in its parent `<Node>` inside a `<Tree>`; a `<Hop>` only in a `<Journey>`; an `<Item>` only in a `<Layer>`. Below, each diagram is followed by its parts. A prop name a component does not take, or a value outside the ones it lists, fails the build naming the closest one.

`<Timeline>` here is the diagram; the `timeline` layout has [its own page](https://sandrinodm.github.io/deckster/reference/layouts/timeline/).

A node's `kind` sets its shape and icon (`service`, `database`, `queue` and so on, each with aliases), its `state` takes one of five values (`default`, `highlighted`, `muted`, `error`, `success`; words that mean the same are accepted), `<Edge>` takes options such as a dashed line, a route style or an arrow at both ends, and `card` picks the node style the brand defines. All four are listed under [node kinds, states, edges and cards](#node-kinds-states-edges-and-cards) at the end of this page.

`card` is a shared prop of `<Node>`, `<Actor>` and `<Item>`, and its own prop on `<Flow>`, `<SequenceDiagram>`, `<Layers>`, `<Layer>`, `<Cycle>` and `<Tree>`; `<Timeline>`, `<Milestone>` and `<Svg>` take none. The names a slide may use depend on the brand: `deck brand <name>` lists them, and the five standard ones exist in every brand.

## Limits

`deck lint` holds diagrams to these numbers, the same as `deck diagrams --json` prints under `limits`:

- **Density.** More than 12 nodes or 16 edges shown at one step is a `diagram-too-dense` warning.
- **Grid.** 5 columns and 3 rows fit comfortably in the `diagram` layout. Past 7 columns or 4 rows the nodes are packed tighter than the gutters allow, and `diagram-too-dense` reports the diagram as cramped.
- **Text.** An edge label takes 18 characters on a line and wraps to 2 lines; past that it ends in an ellipsis, and the full text stays in the accessible summary. A node title wraps to 3 lines at word boundaries before the node grows taller than its row. A word broken across lines leaves at least 3 characters on each.
- **Hard limits.** Past these the build fails: 60 nodes, 120 edges, 24 particles in one packet or edge flow, 64 for a grid column, row, span or minimum size, and step 999 for an `at` or `until`.

## Shared props

Several diagram components and parts take these props, with the same meaning in each. They are listed once here; each entry below names the ones it takes.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `align` | `"left" \| "center" \| "right"` | — | Place a compact drawing to the left, center or right. |
| `lineStyle` | `"solid" \| "dashed" \| "dotted"` | — | The line pattern; uses the brand when omitted. |
| `strokeWidth` | `number` | — | The connector width in canvas pixels. |
| `id` | `string` | — | Its id: what edges, packets and states name it by, and its id in the export description. |
| `title` | `string` | — | What the diagram shows, in a few words: its accessible name. Every diagram needs one; the build fails without it. |
| `height` | `number` | — | A fixed height in canvas pixels; without it the diagram fills its region. |
| `at` | `number` | — | The step that reveals it (or plays it); shown from the start when left out. |
| `until` | `number` | — | The step it stops at (exclusive); without it a packet plays only on `at` and a state lasts to the end. |
| `state` | `"default" \| "highlighted" \| "muted" \| "error" \| "success"` | `default` | The emphasis it starts with. |
| `kind` | `string` | `node` | What it is, which sets its shape and icon: one of the node kinds (`nodeKinds`), or an alias. |
| `icon` | `string \| IconComponent` | — | An Iconify name (MDX), an icon component, a local image or an HTTPS image URL. Use "none" to omit the icon. |
| `card` | `string` | — | The card (a node style the brand defines) it is drawn with: `default`, `outline`, `solid`, `tint` or `raised`, or one of the brand's own (`deck brand <name>` lists them). Without one: the diagram's `card`, else the card the brand maps its kind to, else `default`; a name the brand lacks is skipped. |
| `count` | `number` | `1` | Particles travelling together. |
| `speed` | `"slow" \| "normal" \| "fast"` | `normal` | How fast they travel, as a multiple of the brand's motion. |
| `size` | `"sm" \| "md" \| "lg"` | `md` | How big the dots are. |
| `role` | `"accent" \| "positive" \| "negative" \| "fg"` | `accent` | The color role they travel in. |
| `play` | `"loop" \| "once"` | `loop` | Loop while the step is current, or play once and rest at the end. |
| `col` | `number` | — | The grid column, from 1 on the left. |
| `row` | `number` | — | The grid row, from 1 at the top. |
| `colSpan` | `number` | `1` | How many columns it covers. |
| `rowSpan` | `number` | `1` | How many rows it covers. |

## Components

### Flow

- **Use when:** Any system of boxes and arrows: an architecture, a request path, a pipeline. Place nodes with col/row (spans for wide nodes) or leave cells out for an automatic layout (`layout`, `direction`).
- **Limits:** `nodes` 12, `edges` 16, `columns` 5, `maxColumns` 7, `rows` 3, `maxRows` 4, `maxNodes` 60, `maxEdges` 120, `maxParticles` 24, `maxGridIndex` 64, `maxStep` 999, `labelChars` 18, `labelLines` 2, `titleLines` 3, `minBreakChars` 3

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `cols` | `number` | — | Columns the grid has at least; the cells used decide otherwise. |
| `rows` | `number` | — | Rows the grid has at least. |
| `layout` | `"layered" \| "tree" \| "force" \| "radial"` | `layered` | The automatic layout used when no node has a grid cell. |
| `direction` | `"right" \| "down" \| "left" \| "up"` | `right` | Which way an automatic layout flows. |
| `card` | `string` | — | The card (a node style the brand defines) for all its nodes: `default`, `outline`, `solid`, `tint` or `raised`, or one of the brand's own (`deck brand <name>` lists them). A node's own `card` wins. |
| `children` | `ReactNode` | — | `<Node>`, `<Group>`, `<Edge>`, `<Packet>`, `<Journey>`, `<State>` and `<Focus>` elements. |

Also takes the shared props `align`, `id`, `title`, `height` (see the shared props table on this page).

Example:

```mdx
<Flow title="Checkout request path">
  <Node id="web" kind="client" title="Web app" col={1} row={1} />
  <Node id="api" kind="service" title="Orders API" col={2} row={1} />
  <Node id="db" kind="database" title="Orders DB" col={3} row={1} />
  <Edge from="web" to="api" label="HTTPS" />
  <Edge from="api" to="db" label="SQL" />
  <Journey at={1} path="web api db" back />
</Flow>
```

### Node

- **Goes in:** `<Flow>`, `<Group>`, `<Tree>` (nested in its parent `<Node>`) or `<Cycle>`
- **Use when:** A box in a `<Flow>`, `<Tree>` or `<Cycle>`. `kind` sets its shape and icon; `icon` overrides it ("none" drops it).
- **Limits:** `titleLines` 3

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `width` | `number` | — | Preferred width in canvas pixels, reduced to fit the region. |
| `height` | `number` | — | Minimum height in canvas pixels; grows to fit the text. |
| `id` (required) | `string` | — | The id edges and packets name it by. |
| `title` | `string` | — | The name on the node; the id when left out. Wraps at word boundaries. |
| `subtitle` | `string` | — | A second, quieter line, such as `Postgres 16`. |
| `badge` | `string` | — | A small status pill on a corner of the node, such as `503`: the top right unless an edge runs there, then the first free corner. |
| `children` | `ReactNode` | — | In a `<Tree>`, its child `<Node>`s; elsewhere content of your own instead of the title and subtitle. |

Also takes the shared props `kind`, `state`, `at`, `icon`, `card`, `col`, `row`, `colSpan`, `rowSpan` (see the shared props table on this page).

Example:

```mdx
<Node
  id="db"
  kind="database"
  title="Orders DB"
  subtitle="Postgres 16"
  col={4}
  row={2}
/>
```

### Group

- **Goes in:** `<Flow>` or another `<Group>`
- **Use when:** A labelled container (a VPC, a region, "Client side"): nest the nodes in it; it wraps them, or takes its own col/row/colSpan/rowSpan.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `strokeWidth` | `number` | — | The outline width in canvas pixels; zero hides it. |
| `id` | `string` | — | Its id; made from the label when left out. |
| `label` (required) | `string` | — | The label in its top-left corner, such as `VPC`. |
| `children` | `ReactNode` | — | The `<Node>`s and inner `<Group>`s inside it. |

Also takes the shared props `lineStyle`, `at`, `col`, `row`, `colSpan`, `rowSpan` (see the shared props table on this page).

Example:

```mdx
<Group label="Production VPC">
  <Node id="api" kind="service" title="API" col={2} row={1} />
</Group>
```

### Edge

- **Goes in:** `<Flow>` or `<Cycle>`
- **Use when:** A connection between two nodes; `to` equal to `from` draws a small loop on the node (a retry). In a `<Cycle>`, an `<Edge>` between consecutive stages labels or styles that arc.
- **Limits:** `labelChars` 18, `labelLines` 2

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `id` | `string` | — | Its id, for `<State edge>`; `from->to` when left out. |
| `from` (required) | `string` | — | The node it starts at. |
| `to` (required) | `string` | — | The node it ends at; the same node as `from` draws a small loop on it, such as a retry. |
| `label` | `string` | — | Text beside the line, such as `HTTPS`. Wraps after about 18 characters to two lines, then is cut with an ellipsis. |
| `dashed` | `boolean` | `false` | A dashed line, for asynchronous or optional links. |
| `async` | `boolean` | `false` | Another name for `dashed`. |
| `route` | `"orthogonal" \| "straight" \| "curved"` | `orthogonal` | How it runs between its nodes. |
| `arrow` | `"end" \| "start" \| "both" \| "none"` | `end` | Where arrowheads go. |
| `bidirectional` | `boolean` | `false` | Arrowheads at both ends; `arrow="both"`. |
| `fromSide` | `"top" \| "right" \| "bottom" \| "left"` | — | The side of `from` it leaves by. |
| `toSide` | `"top" \| "right" \| "bottom" \| "left"` | — | The side of `to` it enters by. |
| `flow` | `boolean \| number \| { count, speed, size, role, reverse }` | — | Continuous traffic along it: `true`, a particle count, or the details. |

Also takes the shared props `strokeWidth`, `lineStyle`, `at`, `state` (see the shared props table on this page).

Example:

```mdx
<Edge from="api" to="db" label="SQL" />
<Edge from="worker" to="worker" label="retry" />
```

### Packet

- **Goes in:** `<Flow>` or `<Cycle>`
- **Use when:** Traffic along edges on a step: `from`/`to` or a multi-hop `path`, `at` (plays while that step is current) and `until` (to keep playing), `reply` for out, pause and back. Loops by default; `play="once"` rests at the end. from = to rides a self loop.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `from` | `string` | — | The node it starts at. |
| `to` | `string` | — | The node it travels to; `from` again rides a self loop. |
| `path` | `string \| string[]` | — | Several hops instead of `from` and `to`: node ids in order. |
| `label` | `string` | — | A short tag that rides with it, such as `GET /cart`. |
| `reply` | `boolean \| string` | — | Come back after a pause at the far end: `true`, or the response's tag. |

Also takes the shared props `at`, `until`, `count`, `speed`, `size`, `role`, `play` (see the shared props table on this page).

Example:

```mdx
<Packet from="web" to="api" at={2} label="POST /orders" reply="201" />
```

### Journey

- **Goes in:** `<Flow>`
- **Use when:** A request travelling hop by hop, one hop per step: `path` with `back` for the response, or `<Hop>` children with their own labels and replies; `focus` dims everything off the path; travelled edges stay lit (`trail`); `pace="trip"` plays the whole path on one step.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `id` | `string` | — | Its id. |
| `at` | `number` | `1` | The step of the first hop; later hops take the steps after it. |
| `path` | `string \| string[]` | — | The nodes it passes through: one hop per pair. |
| `back` | `boolean` | `false` | Come back along the path afterwards, one hop per step. |
| `pace` | `"hop" \| "trip"` | `hop` | `hop` gives each hop its own step; `trip` plays the whole path on `at`. |
| `focus` | `boolean` | `false` | Dim everything off the path while it plays. |
| `trail` | `boolean` | `true` | Keep travelled edges lit. |
| `children` | `ReactNode` | — | Explicit `<Hop>`s, instead of `path`. |

Also takes the shared props `count`, `speed`, `size`, `role`, `play` (see the shared props table on this page).

Example:

```mdx
<Journey at={1} path="browser cdn gateway orders db" back focus />
```

### Hop

- **Goes in:** `<Journey>`
- **Use when:** One hop of a `<Journey>`, with its own tag and reply.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `from` | `string` | — | The node it starts at. |
| `to` | `string` | — | The node it travels to. |
| `path` | `string \| string[]` | — | Several nodes in one hop, instead of `from` and `to`. |
| `at` | `number` | — | Its step; the step after the previous hop's when left out. |
| `label` | `string` | — | A tag that rides with the packet. |
| `reply` | `boolean \| string` | — | Come back after a pause: `true` or the response's tag. |
| `returning` | `boolean` | `false` | Draw it as a reply on its way back. |

Also takes the shared props `count`, `speed`, `size`, `role`, `play` (see the shared props table on this page).

Example:

```mdx
<Hop from="api" to="db" label="SELECT" reply="12 rows" />
```

### State

- **Goes in:** `<Flow>` or `<Cycle>`
- **Use when:** Change a node or an edge from a step on: is="highlighted", "error", "success", "muted" or "default", with a `badge`.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `node` | `string` | — | The node it changes. |
| `edge` | `string` | — | The edge it changes, by id (`from->to` unless it has its own). |
| `is` (required) | `"default" \| "highlighted" \| "muted" \| "error" \| "success"` | — | The emphasis it sets from `at` (to `until`). |
| `badge` | `string` | — | A badge to show meanwhile, such as `Timeout`. |
| `at` | `number` | `0` | The step it applies from. |

Also takes the shared props `until` (see the shared props table on this page).

Example:

```mdx
<State node="payments" at={3} is="error" badge="Timeout" until={5} />
```

### Focus

- **Goes in:** `<Flow>` or `<Cycle>`
- **Use when:** Dim everything but some nodes (and the edges between them) for a range of steps.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `nodes` (required) | `string \| string[]` | — | The nodes that stay lit, such as `"web api db"`. |
| `at` | `number` | `0` | The first step it applies on. |

Also takes the shared props `until` (see the shared props table on this page).

Example:

```mdx
<Focus at={4} nodes="api queue worker" />
```

### SequenceDiagram

- **Use when:** Who calls whom, in order: a protocol, an API handshake, a retry. `<Actor>`s across the top, `<Message>`s top to bottom; the current message animates.
- **Limits:** `actors` 6, `messages` 10

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `card` | `string` | — | The card (a node style the brand defines) for all its nodes: `default`, `outline`, `solid`, `tint` or `raised`, or one of the brand's own (`deck brand <name>` lists them). A node's own `card` wins. |
| `children` | `ReactNode` | — | `<Actor>`s, then `<Message>`s in order. |

Also takes the shared props `align`, `id`, `title`, `height` (see the shared props table on this page).

Example:

```mdx
<SequenceDiagram title="Charging once">
  <Actor id="web" kind="client" title="Web app" />
  <Actor id="api" kind="service" title="Payments API" />
  <Message from="web" to="api" label="POST /charges" at={1} />
  <Message from="api" to="web" label="201 Created" reply at={2} />
</SequenceDiagram>
```

### Actor

- **Goes in:** `<SequenceDiagram>`
- **Use when:** A participant of a `<SequenceDiagram>`, drawn as a node over its lifeline.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `width` | `number` | — | Preferred width in canvas pixels, reduced to fit the region. |
| `height` | `number` | — | Minimum height in canvas pixels; grows to fit the text. |
| `id` (required) | `string` | — | The id messages name it by. |
| `title` | `string` | — | Its name; the id when left out. |
| `subtitle` | `string` | — | A quieter second line. |

Also takes the shared props `kind`, `icon`, `card` (see the shared props table on this page).

Example:

```mdx
<Actor id="api" kind="service" title="Payments API" />
```

### Message

- **Goes in:** `<SequenceDiagram>`
- **Use when:** An arrow between lifelines; `reply` for a response, `async` for fire-and-forget, from = to for a call to itself.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `from` (required) | `string` | — | The actor it leaves. |
| `to` (required) | `string` | — | The actor it reaches; the same as `from` for a call to itself. |
| `label` | `string` | — | What it says, such as `POST /orders`. |
| `at` | `number` | — | The step that reveals it; it plays while that step is current. |
| `reply` | `boolean` | `false` | A response: a dashed arrow, its packet a ring. |
| `async` | `boolean` | `false` | An asynchronous message: a dashed arrow. |

Also takes the shared props `strokeWidth`, `lineStyle`, `play`, `state` (see the shared props table on this page).

Example:

```mdx
<Message from="web" to="api" label="POST /charges" at={1} />
```

### Timeline

- **Use when:** Milestones in time order, with where we are now: a roadmap, a migration, a history. The line fills up to the latest milestone shown, or the one marked `current`.
- **Limits:** `milestones` 6

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | — | The `<Milestone>`s, in time order. |

Also takes the shared props `align`, `id`, `title`, `height` (see the shared props table on this page).

Example:

```mdx
<Timeline title="Migration">
  <Milestone date="Q1" title="Split checkout" at={1}>Orders live</Milestone>
  <Milestone date="Q2" title="Move payments" at={2} current />
</Timeline>
```

### Milestone

- **Goes in:** `<Timeline>`
- **Use when:** One milestone of a `<Timeline>`: date, title and a short line of detail as children.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `date` (required) | `string` | — | When, as it should read: `Q1 2026`, `March`. |
| `title` (required) | `string` | — | What happens, in a few words. |
| `current` | `boolean` | `false` | Marks where we are now; once revealed it stays current over later milestones. |
| `children` | `ReactNode` | — | A short line of detail under the title. |

Also takes the shared props `at`, `state`, `icon` (see the shared props table on this page).

Example:

```mdx
<Milestone
  date="Q3 2026"
  title="Region cells"
  at={3}
  current
>
  EU and US apart
</Milestone>
```

### Layers

- **Use when:** A stacked architecture or ownership map: `<Layer>` bands top to bottom, each with `<Item>` chips.
- **Limits:** `layers` 6, `itemsPerLayer` 6

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `card` | `string` | — | The card (a node style the brand defines) for all its items: `default`, `outline`, `solid`, `tint` or `raised`, or one of the brand's own. An item's own `card` wins; the bands keep the stack's look unless a `<Layer>` names a card. |
| `children` | `ReactNode` | — | The `<Layer>`s, top to bottom. |

Also takes the shared props `align`, `id`, `title`, `height` (see the shared props table on this page).

Example:

```mdx
<Layers title="Platform">
  <Layer title="Edge" subtitle="Platform team" at={1}>
    <Item kind="gateway" title="API gateway" />
  </Layer>
</Layers>
```

### Layer

- **Goes in:** `<Layers>`
- **Use when:** One band of a `<Layers>` stack. While the stack is built, the band its `at` step adds is picked out; once the last band is in, only bands with `state` stand out, so mark the band the stack is about with `state="highlighted"`.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `title` (required) | `string` | — | The layer's name, such as `Data`. |
| `subtitle` | `string` | — | What it does or who owns it. |
| `card` | `string` | — | The card its band is drawn with: `default`, `outline`, `solid`, `tint` or `raised`, or one of the brand's own; without one the band keeps the stack's look (a tint with a bold left edge). |
| `children` | `ReactNode` | — | Its `<Item>`s. |

Also takes the shared props `at`, `state` (see the shared props table on this page).

Example:

```mdx
<Layer title="Data" subtitle="Data team" at={4}>
  <Item kind="database" title="Postgres" />
</Layer>
```

### Item

- **Goes in:** `<Layer>`
- **Use when:** One building block in a `<Layer>`, as a chip with its kind’s icon.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `title` (required) | `string` | — | Its name. |

Also takes the shared props `kind`, `icon`, `state`, `card` (see the shared props table on this page).

Example:

```mdx
<Item kind="queue" title="Kafka" />
```

### Cycle

- **Use when:** A loop of stages that repeats: an incident loop, a feedback cycle, an agent loop. `steps` walks it one stage per step; `spin` keeps a packet circling; an `<Edge>` between consecutive stages labels that arc.
- **Limits:** `stages` 8

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `steps` | `boolean` | `false` | Walk the loop one stage per step. |
| `spin` | `boolean` | `false` | Keep a packet circling while the slide is on screen. |
| `card` | `string` | — | The card (a node style the brand defines) for all its nodes: `default`, `outline`, `solid`, `tint` or `raised`, or one of the brand's own (`deck brand <name>` lists them). A node's own `card` wins. |
| `children` | `ReactNode` | — | The stages as `<Node>`s in order from the top, plus `<Edge>` (to label or style an arc), `<State>`, `<Packet>` and `<Focus>`. |

Also takes the shared props `align`, `id`, `title`, `height` (see the shared props table on this page).

Example:

```mdx
<Cycle title="Incident loop" steps>
  <Node id="detect" title="Detect" />
  <Node id="respond" title="Respond" />
  <Node id="learn" title="Learn" />
  <Edge from="learn" to="detect" label="new alert" />
</Cycle>
```

### Tree

- **Use when:** A hierarchy: an org chart, a decision tree, a module tree. Nest `<Node>`s; `direction` down or right; `at` on a node reveals its branch.
- **Limits:** `nodes` 12, `leaves` 7, `depth` 4

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `direction` | `"down" \| "right"` | `down` | Which way it grows. |
| `card` | `string` | — | The card (a node style the brand defines) for all its nodes: `default`, `outline`, `solid`, `tint` or `raised`, or one of the brand's own (`deck brand <name>` lists them). A node's own `card` wins. |
| `children` | `ReactNode` | — | One root `<Node>`, with its children nested inside it. |

Also takes the shared props `align`, `id`, `title`, `height` (see the shared props table on this page).

Example:

```mdx
<Tree title="Pricing rules">
  <Node id="price" kind="decision" title="Price?">
    <Node id="zone" title="Zone" />
    <Node id="weight" title="Weight" at={1} />
  </Node>
</Tree>
```

### Svg

- **Use when:** A drawing someone made (a floor plan, a product sketch, an exported figure): inlined and cleaned at build time (no scripts, event handlers or external references), it takes brand colors (`recolor`, or data-fill/data-stroke on shapes), reveals elements by id per step (`steps`) and can draw its strokes on (`draw`).

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `src` (required) | `string` | — | In MDX a relative path to an .svg file, inlined at build time; in TSX the markup (`?raw` import). |
| `title` (required) | `string` | — | What the drawing shows, for people who cannot see it. |
| `steps` | `Record<string, number>` | — | Elements to reveal by step, by id: `{{ dock: 1, sorting: 2 }}`. |
| `draw` | `boolean` | `false` | Draw the strokes of each element on as it is revealed. |
| `recolor` | `Record<string, SvgRole>` | — | Colors in the file to replace with color roles: `{{ "#ff5a1f": "accent" }}` (`svgRoles`). |

Also takes the shared props `height` (see the shared props table on this page).

Example:

```mdx
<Svg
  src="../assets/floor.svg"
  title="The warehouse floor"
  steps={{ inbound: 1, sorting: 2 }}
  recolor={{ "#e4572e": "accent" }}
  draw
/>
```

## Node kinds, states, edges and cards

**Node kinds**

| kind | Shape | Icon (lucide / tabler) | Use when |
| --- | --- | --- | --- |
| `service` | card | server / server-2 | An application service or API you run: orders API, auth service, a backend. |
| `database` (also `db`) | cylinder | database / database | A database or any system of record: Postgres, DynamoDB, a ledger. |
| `queue` (also `stream` `bus`) | pipe | list-ordered / list-numbers | A queue, stream or event bus: SQS, Kafka topic, a job queue. |
| `cache` | stack | zap / bolt | An in-memory cache in front of something slower: Redis, Memcached, an edge cache. |
| `storage` (also `bucket`) | card | archive / bucket | Object or file storage: an S3 bucket, a blob store, a file share. |
| `user` (also `person`) | pill | user / user | A person: a customer, an operator, a reviewer. Usually where a journey starts. |
| `client` (also `browser` `web` `app`) | window | app-window / browser | A browser or desktop client: the web app, a single-page app, a CLI on a laptop. |
| `mobile` (also `phone`) | device | smartphone / device-mobile | A mobile app or device. |
| `cloud` | soft | cloud / cloud | A managed platform or the internet as a whole: a CDN, a cloud provider, "the web". |
| `external` (also `third-party`) | dashed | globe / world | A system outside your boundary that you call or that calls you: Stripe, a partner API. |
| `function` (also `lambda` `worker`) | chamfer | lambda / lambda | A serverless function or a worker that runs on demand: Lambda, a cron job. |
| `gateway` (also `proxy`) | hexagon | network / network | An API gateway, reverse proxy or ingress that routes requests inward. |
| `loadbalancer` (also `lb` `load-balancer`) | hexagon | split / arrows-split-2 | A load balancer that spreads traffic over several instances. |
| `agent` | double | bot / robot | An AI agent: the loop that plans, calls tools and talks to a model. |
| `llm` (also `model`) | double | sparkles / sparkles | A language model endpoint: the model an agent or a feature calls. |
| `tool` | card | wrench / tool | A tool an agent can call: search, code execution, a calendar API. |
| `document` (also `file`) | folded | file-text / file-text | A document, file, report or prompt: a PDF, a config file, a knowledge base page. |
| `decision` | diamond | none | A yes/no branch in a process; keep its title to a short question. |
| `node` (also `generic`) | card | none | Anything else: give it an `icon` from the brand set, or children of your own. |

**States**

| State | Also accepted |
| --- | --- |
| `default` | — |
| `highlighted` | `highlight` |
| `muted` | `mute` `dim` `dimmed` |
| `error` | `fail` `failed` `failure` |
| `success` | `ok` `done` `recover` `recovered` |

**Edge options**

- `label`: What travels on the edge (HTTPS, SQL, publish); it sits beside the line, never on a node. Wraps after about 18 characters. `<Edge from="api" to="db" label="SQL" />`
- `dashed / async`: An asynchronous, optional or eventual link (events, replication, fire-and-forget). `<Edge from="orders" to="events" async />`
- `lineStyle / strokeWidth`: Vary an ordinary connector's line pattern or width in canvas pixels. `<Edge from="checkout" to="dispatch" lineStyle="dotted" strokeWidth={3} />`
- `route: orthogonal | straight | curved`: orthogonal (the default) routes around nodes with rounded corners; straight runs centre to centre; curved bends gently between ports. `<Edge from="a" to="b" route="curved" />`
- `arrow: end | start | both | none`: Where arrowheads go; `bidirectional` is arrow="both". `<Edge from="agent" to="model" bidirectional />`
- `fromSide / toSide`: Force the side an edge leaves or enters by (top, right, bottom, left) when the router picks another. `<Edge from="api" to="cache" fromSide="top" toSide="bottom" />`
- `self loop`: An edge whose `from` and `to` are the same node draws a small loop on it, such as a retry; a packet from and to that node rides it. `<Edge from="worker" to="worker" label="retry" />`
- `flow`: Continuous traffic along an edge while it is shown: `flow`, `flow={5}` or `flow={{ count, speed, size, role, reverse }}` (see `edgeFlow`). `<Edge from="orders" to="bus" label="publish" flow={{ count: 3 }} />`
- `at / state / id`: Reveal the edge at a step, start it in a state, or name it for `<State edge="...">`. `<Edge id="auth" from="api" to="idp" at={2} />`

**Cards** (`card="..."`)

A node's card is, in order: its own `card`; its diagram's `card`; the card the brand maps its kind to (`diagram.kinds` in brand.ts); `default`. A name the brand does not have is skipped (the next in that order applies) and the node carries `data-card-missing` with the name asked for; every node carries `data-card` with the card it uses.

| Card | Look, unless the brand restyles it |
| --- | --- |
| `default` | The brand's node: its node fill and border, the icon in a bordered tile. |
| `outline` | No fill, the node border only. |
| `solid` | Filled in the accent, no border, text in the accent foreground. |
| `tint` | The accent at a low opacity with an accent border and a filled icon tile. |
| `raised` | The surface fill, a hairline border and the brand's medium shadow. |

Every brand has the five standard cards and may restyle them or define more of its own (`deck brand <name>` lists them). Stick to the standard names for a deck that should look right in any brand.

- States still win over the card: highlighted, error and success recolor the outline and show the halo, muted and a focus dim the node.
- On `<Layers>` the items follow the stack's `card`; the bands keep the stack's own look unless a `<Layer>` names a card.
- Pick a card for a reason (a role, a group of nodes that belong together), not per node at random: one or two cards on a slide besides the default.

Source: https://sandrinodm.github.io/deckster/reference/diagrams/index.mdx
