Trace
A composable sequence of agent steps, tool activity, progress, and expandable details.
Trace presents the work behind an answer as a compact sequence of readable steps. It is useful for agent reasoning summaries, tool activity, file operations, build progress, and other process history. Zenos keeps the root and lines semantically neutral so the surrounding product can choose the right list, status, link, or disclosure semantics.
Import
Section titled “Import”import { Trace } from "@zentara-co/zenos-ui";Composition
Section titled “Composition”<Trace> <Trace.Line status="running" role="status"> <Trace.Icon> <SpinnerIcon /> </Trace.Icon> <Trace.Title>Checking dependencies</Trace.Title> <Trace.Description>2.4s</Trace.Description> </Trace.Line></Trace>Trace.Icon is decorative and always hidden from assistive technology. Put the meaning of the step
in Trace.Title. Trace.Description is optional metadata such as elapsed time, a count, or a short
result.
Status
Section titled “Status”Omit status for completed work. Use running, pending, or error for the remaining visual states.
Status only changes presentation; add role="status" when a newly rendered running step should be
announced.
Expandable details
Section titled “Expandable details”Use the collapsible parts when a concise step has optional details. They follow the same controlled and uncontrolled open-state contract as Collapsible.
<Trace.Collapsible defaultOpen> <Trace.CollapsibleTrigger> <Trace.Line> <Trace.Title>Read component files</Trace.Title> </Trace.Line> </Trace.CollapsibleTrigger> <Trace.CollapsibleContent>Trace.tsx and Trace.test.tsx</Trace.CollapsibleContent></Trace.Collapsible>Links and actions
Section titled “Links and actions”Trace.Line is a non-interactive span. Wrap it with a native link, button, dialog trigger, or
another appropriate interactive component rather than adding click behavior to the line itself.
Custom styling
Section titled “Custom styling”Every part accepts className and style. Use these escape hatches to adjust spacing or emphasis
without replacing the component’s state and accessibility behavior.
Trace uses logical spacing and text alignment. The disclosure indicator follows the current document
direction. Mirror directional application icons with rtl:rotate-180 when their meaning changes.
Variants
completerunningpendingerror Trace.Root Trace.Line Trace.Icon Trace.Title Trace.Description Trace.Collapsible Trace.CollapsibleTrigger Trace.CollapsibleContent
API
| Prop | Type | Default | Description |
|---|---|---|---|
Line.status | running | pending | error | — | Optional visual state. Omit the status for a completed step. |
Collapsible open / defaultOpen | boolean | false | Controlled or initial visibility of the detail panel. |
Collapsible onOpenChange | (open: boolean, eventDetails) => void | — | Runs when the trace detail panel opens or closes. |
CollapsibleContent.keepMounted | boolean | false | Keeps the detail panel mounted while closed. |
Line / Icon / Title / Description | HTMLAttributes<HTMLSpanElement> | — | Forward native attributes, refs, styles, classes, and data attributes. |
native props | React.HTMLAttributes<HTMLDivElement> | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props,
including className, style, aria-*, and data-*.
Accessibility
Section titled “Accessibility”- Keep every step’s meaning in
Trace.Title; icons are decorative. - Add
role="status"only to new progress that should be announced, not to static history. - Wrap interactive lines in native controls with a clear accessible name.
- Do not communicate running, pending, or error state through color alone; write descriptive text when the state affects the user’s next action.
- The collapsible trigger supplies button semantics, keyboard interaction, and expanded state.
The component is adapted to Zenos conventions from the shadcn Trace pattern.