Ballmac UI home

Trace

The one row behind reasoning, tool calls, sources and plans: an icon, a title and optional detail, with running, error and pending states, rows that expand, link or open a dialog, and shadcn's Trace API.

Searched for minimumReleaseAge
Edited pnpm-workspace.yaml+3 −1Read the Astro guide (opens in a new tab)Running pnpm build

Installation

$ pnpm dlx shadcn@latest add @ballmac/trace

Usage

import { Trace, TraceCollapsible, TraceCollapsibleContent, TraceCollapsibleTrigger, TraceDescription, TraceIcon, TraceLine, TraceTitle } from "@/components/ballmac/trace"

The full example is in the Code tab above.

Examples

Running, error and pending

Ran pnpm install2.4sRunning pnpm buildFailed to run pnpm lintexit 1Run pnpm test

Opens while it streams

The lockfile pins 9.1.0, so the new option is not available yet. I will check the changelog before changing the setting.

pnpm 9.1.0
└── (not found)

Chain of thought

Read the old schemaWrote the new tablesBackfilled 12,408 rowsSwitching reads to the new tables

Sources

Opens a dialog

An agent turn with a question

Read 4 filessrc/billing

The totals ignore quantity, and one tax rate is missing. Which should I fix first?

API reference

<TraceLine>

PropTypeDefault
status

The state of the work the line reports. Say it in the title too: color and motion alone are not read out.

TraceStatus—

<TraceCollapsible>

PropTypeDefault
open

The controlled open state. Pass it with `onOpenChange`.

boolean—
defaultOpen

Whether the row starts open.

booleanfalse
onOpenChange(open: boolean) => void—
disabledbooleanfalse

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Enter / SpaceOn a TraceCollapsibleTrigger, opens or closes the row (aria-expanded and aria-controls are set)
TabA TraceLine on its own is text and not a tab stop; the trigger, link or dialog trigger around it is
Screen readersIcons are hidden, so the title is the name: write a sentence (Edited trace.tsx) and put the state in it (Running pnpm build). Closed content is inert
Reduced motionThe shimmer and the chevron turn stop; the title still says what is happening

Quality scorecard

7/7

Every applicable check passes

Measured in Chromium 153.0.8010.12 on October 19, 2026, on version 1.0.0, across 7 examples.

How we measure
  • Passed: Accessibility scan

    No serious or critical issues in light and dark, on a phone and a desktop (axe-core 4.13.0, WCAG 2.1 AA and best-practice rules).

  • Passed: Small screens

    No sideways scrolling at 360, 390 or 1280 px wide.

  • Passed: Reduced motion

    Every endless animation stops when the visitor asks for less motion.

  • Passed: Right to left

    Mirrors correctly in Arabic, Hebrew, Persian and Urdu layouts (4% of elements off the mirror, limit 15%).

  • Passed: Clean console

    No console errors or React hydration errors while loading.

  • Passed: Keyboard

    10 tab stops, each showing a visible change when it takes focus. 4 documented keys.

  • Not applicable: Loading, empty and error

    A row shows the state of work reported to it (running, error, pending); it loads and fetches nothing itself.

  • Passed: Automated tests

    Covered by trace.test.tsx.

  • For information: Footprint

    2.6 KB of source (gzip) in 1 file. Installs lucide-react.

Automated checks find a subset of problems and do not replace testing with a screen reader and a keyboard in your own app. What they miss.

Use with AI

<Trace> holds rows. A row is <TraceLine status><TraceIcon/><TraceTitle/><TraceDescription/></TraceLine>. Wrap it in <TraceCollapsibleTrigger> inside a <TraceCollapsible> to expand, or in a link, or a dialog's trigger. The parts and props match shadcn's Trace. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Trace (@ballmac/trace) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Showing what an AI agent did: reasoning, tool calls, searches, file edits
  • Plans, task lists and sources where every row should look the same
  • Rows that expand, link out or open a dialog or sheet

Not for

  • The agent's reply text; use message or ai-message
  • A single tool call with its full input and output; use tool-call-card
  • A general disclosure; use collapsible or accordion

Registry JSON: https://ui.ballmac.com/r/trace.json

Credits

Based on shadcn/ui Trace, adapted by Ballmac. Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.