Skip to content
Haze UI

Trace

An AI agent's steps as a list: an icon per kind, a title, status text, duration and expandable tool input and output.

pnpm dlx shadcn@latest add @haze/trace
Open preview in a new tab
Liveno JavaScript

When to use

  • An assistant works through several steps and the user should see what it searched, read, edited and ran
  • A tool call needs its raw input or output available on demand without crowding the list
  • A failed or skipped step must be visible next to the steps that worked

When not to use

  • Events are dated entries in a history, not steps of one run. Use timeline.
  • The output is a raw stream of log lines. Use log-viewer.
  • Progress through a user-driven flow is shown with numbered stages. Use stepper.

Installation

Add the Haze registry to components.json once, then install Trace with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.

pnpm dlx shadcn@latest add @haze/trace
First time? Registry and theme setup

1. Add to components.json:

{
  "registries": {
    "@haze": "http://localhost:4329/r/{name}.json"
  }
}

2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";

API reference

PropTypeDefaultDescription
steps{ kind: "tool" | "thought" | "search" | "edit" | "message"; title: string; description?: string; status?: "running" | "done" | "error" | "skipped"; duration?: string; href?: string; detail?: string; open?: boolean }[]five-step agent runSteps in order. href makes the title a link; detail adds an expandable block.
labelstring"Agent steps"Accessible name of the list.
detailLabelstring"Details"Summary text of the expandable detail.
kindLabelsRecord<kind, string>Tool call, Reasoning, Search, File edit, MessageScreen-reader prefix for each step kind. Translate it.
statusLabelsRecord<status, string>Running, Done, Failed, SkippedVisible status text. Translate it.
classstring–Extra classes on the list.

Keyboard interactions

Tab
Move through step links, detail toggles and focusable detail blocks.
EnterSpace
Open or close a step's detail.
Arrow keys
Scroll a focused detail block.

Accessibility

  • Steps are an ordered list. Each title starts with its kind for screen readers, because the icon is decorative.
  • Status is always text next to its icon, never color alone. The spinning icon of a running step stops under reduced motion and the word Running remains.
  • Details use native details and summary. The block scrolls inside itself, is focusable and has its own label so keyboard users can scroll it.
  • The thin line joining the steps is decorative and hidden from assistive technology.

Notes for AI

Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.

  • Install and use

    Install the Haze UI component "Trace" with `npx shadcn@latest add @haze/trace`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "http://localhost:4329/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import Trace from "@/components/haze/ui/trace.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: http://localhost:4329/ui/trace.md

  • Customize with real content

    Adapt the Haze trace ui for our product. Replace the demo values of these props with our real content: steps, label, detailLabel, kindLabels, statusLabels, class. Keep the layout, the heading level rules and these accessibility details: Steps are an ordered list. Each title starts with its kind for screen readers, because the icon is decorative. Status is always text next to its icon, never color alone. The spinning icon of a running step stops under reduced motion and the word Running remains. Details use native details and summary. The block scrolls inside itself, is focusable and has its own label so keyboard users can scroll it. The thin line joining the steps is decorative and hidden from assistive technology. Do not add raw color classes; use the Haze tokens.

  • Choose the right block

    Before using trace, check it fits: use it when an assistant works through several steps and the user should see what it searched, read, edited and ran; a tool call needs its raw input or output available on demand without crowding the list; a failed or skipped step must be visible next to the steps that worked. Avoid it when events are dated entries in a history, not steps of one run. use timeline.; the output is a raw stream of log lines. use log-viewer.; progress through a user-driven flow is shown with numbered stages. use stepper.. Alternatives: @haze/timeline, @haze/log-viewer, @haze/stepper, @haze/accordion.

Dependencies

  • npm: @lucide/astro
  • @haze/utils
  • @haze/theme (one-time setup)

Source · Original Haze UI work.

Catalog

↑↓ moveEnter openEsc close

Keyboard shortcuts

CtrlK
Command palette
/
Focus search
←↑→↓
Move between cards
jk
Next / previous card
ci
Copy code / install command (detail page)
[]
Previous / next entry
?
This help
Esc
Close dialog