Agent 执行轨迹

New

Agent 执行轨迹组件族:发丝竖轨上按类型着装的步骤节点、带脉冲环与节奏扫光的进行中步骤、原始输出展开、并行工具组,以及可嵌套展开的子 Agent 迷你轨迹。

安装

用 shadcn CLI 添加,或手动复制源码。

$ bunx --bun shadcn add @uilab/agent-trace

API 参考

Trace

className?
string

TraceStep

kind?
"done" | "plan" | "tool" | "reflection"

Drives the icon-node border style and the default icon;

tool
icon?
ReactNode

13px icon overriding the `kind` default (Sparkles/Wrench/RefreshCw/Check).

label
ReactNode
detail?
ReactNode

Second line under the label.

meta?
ReactNode

Right-floating slot, e.g. elapsed time — pass a colored span for a slow-running highlight.

active?
boolean

Live state: pulses the icon ring and shimmers the label.

false
open?
boolean

Controlled "View raw" open state — only meaningful when `children` is passed.

onOpenChange?
((next: boolean) => void)
children?
ReactNode

Raw content revealed by "View raw", e.g. a mono JSON block styled by the caller.

className?
string

TraceCostBadge

tokens?
number
cost?
number
className?
string

TraceGroup

label
ReactNode

Header line, e.g. "Running 3 tools in parallel".

className?
string

TraceSubagent

label
ReactNode
open?
boolean

Controlled expand state.

onOpenChange?
((next: boolean) => void)
children?
ReactNode

Nested `TraceStep`s — rendered inside a mini `Trace` of their own.

className?
string

TraceSummary

duration?
ReactNode
tokens?
number
cost?
number
className?
string

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.