# Timeline Layout

> Ordered horizontal event rail with alternating above/below callouts and pulsing sweep highlights.

Use `timeline` for ordered hook callbacks, request lifecycles, or release milestones along a single run.

## Live Interactive Example

```diagram
type: timeline
label: "Six hook events firing in order across one agent turn."
eyebrow: Lifecycle Hooks
events:
  - { title: before_agent, note: "load memory", description: "Injects user preferences and session state." }
  - { title: before_llm, note: "prompt final", description: "Last chance to redact secrets or trim context." }
  - { title: before_tool, note: "approve / block", highlight: true, description: "Enforces human approval or policy guardrails before running a tool." }
  - { title: after_tool, note: "audit log", description: "Logs structured tool output and latency." }
  - { title: after_llm, note: "verify schema", description: "Checks structured output and citations." }
  - { title: after_agent, note: "reply ready", description: "Persists turn transcript and emits completion." }
```

## Step-by-Step Guide

1. **Set `type: timeline`** and a concise `label`.
2. **List 2–10 `events`** in firing order — labels automatically alternate above and below the rail so adjacent events never collide.
3. **Highlight critical gates** (like `before_tool`) with `highlight: true`.
4. **Add `description` or `code`** so readers can click any event dot to read hook details.

## YAML Source

```yaml
type: timeline
label: "Six hook events firing in order across one agent turn."
eyebrow: Lifecycle Hooks
events:
  - { title: before_agent, note: "load memory" }
  - { title: before_llm, note: "prompt final" }
  - { title: before_tool, note: "approve / block", highlight: true }
  - { title: after_tool, note: "audit log" }
  - { title: after_llm, note: "verify schema" }
  - { title: after_agent, note: "reply ready" }
```

## Field Reference

| Field | Required | Description |
|---|---|---|
| `type` | Yes | Must be `timeline` |
| `label` | Yes | Accessible 1-sentence summary |
| `events` | Yes | 2–10 ordered event items (`{ title, note?, highlight?, description?, code? }`) |
| `eyebrow` | No | Uppercase header over the rail |

## Related pages

- [Stack Layout](https://diagram.praison.ai/docs/layouts/stack.md)
- [Flow Layout](https://diagram.praison.ai/docs/layouts/flow.md)
- [Fan Layout](https://diagram.praison.ai/docs/layouts/fan.md)
