Xzero UI
Pro library

Agent timelinePro

A compact timeline of one orchestrated agent run: the orchestrator and its subagents share a time axis, handoffs draw in between rows, and a playhead replays thinking, tool calls and waiting while the header counts time, tokens and cost. Hover a span for what it did, or click it to trace its handoff path.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/agent-timeline
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/agent-timeline

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { AgentTimeline } from "@/components/xzero/agent-timeline/agent-timeline";

// The sample run, replaying.
<AgentTimeline />

// A finished run from your traces renders complete, ready to replay.
<AgentTimeline
  run={{
    title: "Weekly churn report",
    agents: [
      { id: "lead", name: "Orchestrator", model: "Claude Opus 5.5", price: 8 },
      { id: "sql", name: "Analyst", model: "Claude Haiku 5.5", price: 0.2 },
    ],
    spans: [
      { agentId: "lead", kind: "thinking", start: 0, end: 1.4, label: "Planned the report", tokens: 1200 },
      { agentId: "lead", kind: "waiting", start: 1.4, end: 6.2, label: "Waiting on the analyst" },
      { agentId: "sql", kind: "tool", tool: "PostgreSQL", start: 1.7, end: 4.1, label: "Pulled churn by plan", tokens: 2400 },
      { agentId: "sql", kind: "thinking", start: 4.1, end: 5.9, label: "Summarized the numbers", tokens: 900 },
    ],
    handoffs: [
      { from: "lead", to: "sql", at: 1.4, label: "Churn by plan, last 8 weeks" },
      { from: "sql", to: "lead", at: 6.2, label: "Churn is up on the Team plan" },
    ],
  }}
  onSpanSelect={span => console.log(span?.label)}
/>

// Live: keep appending events to the run, leave end off open spans.
<AgentTimeline run={liveRun} live={status === "running"} />

API reference

AgentTimeline

A compact timeline of one orchestrated agent run. Each row is an agent with a color dot, its name and its model with the provider mark, the orchestrator on top. Spans on a shared time axis show thinking (a tint of the agent color), tool calls (solid) and waiting (hatched), and thin elbow connectors show work handed to a subagent and results coming back, with a dot where they meet the orchestrator. The run replays live: a playhead sweeps, the active span grows with a square leading edge and a short shine, connectors draw in as handoffs happen, and the header counts elapsed time, tokens and cost until it settles into a summary such as "5 agents · 26.4s · 1.5x faster than sequential · $0.16". Hover or focus a span for a card with what it did, its tool, duration, tokens and handoffs; click to pin it and dim everything off its handoff path. A failed tool call turns into a cross with a Failed label when it ends, and its retry shows a retry icon. Play, pause, restart, a speed control and scrubbing along the axis drive the replay; passing a finished run renders it complete, and live mode follows a run in progress.

PropTypeDefaultDescription
runAgentTimelineRunsampleRunThe run: { title?, agents, spans, handoffs?, duration?, startedAt? }. Rows follow agents in order and the first agent is the orchestrator. Defaults to a sample incident investigation with five agents, a failed query and a retry.
agentsAgentTimelineAgent[]–Overrides run.agents. Each agent is { id, name, model?, role?, color?, mark?, price? }. color defaults to neutral for the first agent and --series-1 to --series-4 after it; mark is inferred from the model name for Claude, GPT and Gemini; price is a blended USD rate per million tokens used for cost.
spansAgentTimelineSpan[]–Overrides run.spans. Each span is { id?, agentId, kind: "thinking" | "tool" | "waiting", start, end?, label, detail?, tool?, tokens?, cost?, status?: "ok" | "failed", retry? } with times in seconds from the start of the run. tool is a name (GitHub, Web search, PostgreSQL and Notion have built-in marks) or { name, mark }. Leave end out while a span is open in a live run.
handoffsAgentTimelineHandoff[]–Overrides run.handoffs. Each handoff is { from, to, at, label? }. The connector shape is inferred: a dispatch drops from the source at at and enters the target's next span, a result leaves the end of the source's last span and rises into the target.
titlestring–Heading. Defaults to run.title, then "Agent run".
autoPlaybooleantrue for the sample, false with dataReplay from zero when the timeline scrolls into view. Without it a run renders finished, ready to replay. Reduced motion always starts finished until the person presses play.
speednumber1Starting playback speed. 1 is real time.
speedsnumber[][1, 2]Options in the speed control. The control hides when only one speed remains.
livebooleanfalseFollow a run in progress: the clock runs from run.startedAt (epoch ms) or from mount, open spans grow to now, the axis extends in calm steps and the playback controls hide. Append spans and handoffs as events arrive and set live to false when the run ends; the timeline settles on the summary.
onSpanSelect(span: AgentTimelineSpan | null) => void–Called when a span is pinned, with the span, or unpinned, with null.
onComplete() => void–Called once each time a replay reaches the end or a live run ends.
classNamestring–Class on the root element.
styleCSSProperties–Inline style on the root, for example to override --series-1 to --series-4.

Keyboard interactions

KeysAction
TabMoves to the timeline's spans (one tab stop), the time scrubber, then play or pause, restart and the speed control.
Arrow left / Arrow rightOn a span, moves to the previous or next span in the same row. On the scrubber, steps time by half a second; with Shift, by five seconds.
Arrow up / Arrow downOn a span, moves to the nearest span in the row above or below.
Home / EndOn a span, jumps to the first or last span in its row. On the scrubber, jumps to the start or the end of the run.
Page up / Page downOn the scrubber, steps time by five seconds.
Enter, SpaceOn a span, pins it and highlights its handoff path; again to unpin.
EscapeUnpins the pinned span.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in ai

Guidance for AI tools

Agent timeline: A compact timeline of one orchestrated agent run: the orchestrator and its subagents share a time axis, handoffs draw in between rows, and a playhead replays thinking, tool calls and waiting while the header counts time, tokens and cost. Hover a span for what it did, or click it to trace its handoff path. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components