Trace Waterfall

Every call in a run on one time axis, with the slowest path marked.

PROGet Trace Waterfall and 168 other Pro components with pro lifetime — Get Pro

Category
AI Agent
Access
Pro
Source
398 lines · one file
States
6 drawn
Added
12 Oct 2026

The decision inside it

Only the slowest path makes a run slow

Shortening a call off the slowest path does not make the run finish sooner, so that chain is drawn darkest and labelled. Everything else is grey.

When to use it

Use Trace Waterfall to see where a run's time went: every span (model call, tool, HTTP request) as a bar on one timeline, nested under its parent, with errors marked and metadata for the selected span.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Liro's Trace Waterfall for this.
Install it: npx shadcn@latest add @liro/trace-waterfall
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/trace-waterfall.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @liro registry with your CLI token: see the Namespaced tab.

Usage

components/trace.tsx
import { TraceWaterfall, type TraceSpan } from "@/components/ui/trace-waterfall";

const spans: TraceSpan[] = [
  { id: "root", name: "answer_question", kind: "agent", status: "succeeded", startMs: 0, endMs: 2400 },
  { id: "r1", parentId: "root", name: "vector.search", kind: "retrieval", status: "succeeded", startMs: 40, endMs: 380 },
  { id: "m1", parentId: "root", name: "model.generate", kind: "model", status: "succeeded", startMs: 400, endMs: 2350 },
];

export function Trace() {
  return <TraceWaterfall spans={spans} />;
}

API reference

“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

TypeNotes
spansTraceSpan[] Yes–
selectedSpanIdstring | null No–
defaultSelectedSpanIdstring | null No–
onSpanSelect(span: TraceSpan | null) => void No–
timeOriginnumber NoWhere the axis starts. Default: the earliest start.
nownumber No"Now", for spans still running, on the same clock. Default: the latest end.
showMetadataboolean NoShow metadata in the details. Default true.
onOpenSpanDetails(span: TraceSpan) => void NoAdds "Open span" to the details.
maxHeightnumber NoHeight of the list before it scrolls. Default 360.
lookLook NoLayered sets it in a tray, the summary above the card. Flat leaves it on the page.

Dependencies

npm packages

clsxframer-motionlucide-reacttailwind-merge

Liro foundations, installed alongside it

liro-themebadgebuttonstate

States

All of them are drawn by the component. None is left for you to design.

  • Running
  • Failed
  • Span selected
  • Folded
  • Zoomed
  • Bad timing

Accessibility

  • Keyboard reachable throughout, in visual order
  • Focus trapped in overlays, Escape closes them
  • Focus returns to whatever opened it
  • Live regions announce what changed, not that something did
  • Honours prefers-reduced-motion

Responsive behavior

  • Sizes to its container, not the viewport
  • Usable from 320px up
  • Pointer-based interaction, so trackpad and touch both work
  • No hover-only affordances