Skip to content
Browse docs and components

Trace

trace

The steps an agent takes, one line each: reasoning, tool calls, sources, plans and subagent runs. Every line has an icon, a title, a description and a status, sweeps while running, and can open its output, link away, open a dialog, or nest a whole Trace.

Responsive

Install

$npxshadcnadd@forme/trace

Adds the component, its registry dependencies, and the token stylesheet you import once.

Examples

2 more ways to put it to work. Install one by name and it lands beside the component, or copy it from the Code tab into your app.

Lines that open a dialog

TraceRow asChild around a dialog trigger: a source opens its page in a dialog instead of expanding in place.

$npxshadcnadd@forme/trace-overlay
Responsive

From AI SDK message parts

One switch turns reasoning, tool and source parts from useChat into Trace lines, status included.

$npxshadcnadd@forme/trace-ai-sdk
Responsive

API reference

Read from the source, so it is the API of the file you install. A prop marked * is required.

Trace

What an agent did, one line per step.

PropTypeDefaultDescription
labelstring—Names the list for screen readers: "Research", "Steps".

Also takes every prop of <ol> attributes.

TraceItem

One step. A Collapsible root drawn as a list item, so a TraceTrigger inside it opens its TraceContent; with neither, it is just a line.

PropTypeDefaultDescription
status'done' | 'running' | 'error' | 'pending'"done"
defaultOpenboolean—Whether TraceContent starts open. Uncontrolled.
openboolean—
onOpenChange(open: boolean) => void—

Also takes every prop of <li> attributes.

TraceRow

A line that does not open anything here: plain, or a link or overlay trigger with asChild.

PropTypeDefaultDescription
asChildboolean—Merge onto the one child instead: a link, or a dialog, sheet or popover trigger.

Also takes every prop of <div> attributes.

TraceContent

What the step opens into: its output, its sources, or a nested Trace. Lined up under the title, so the hairline runs past it to the next step.

PropTypeDefaultDescription
childrenReactNode—

Also takes every prop of Omit<ComponentProps<typeof Collapsible.Panel>, "children">.

The other parts

  • TraceTriggerTakes ComponentProps<typeof Collapsible.Trigger>
  • TraceIconTakes <span> attributes
  • TraceTitleTakes <span> attributes
  • TraceDescriptionTakes <span> attributes
  • TraceStatusTakes <span> attributes