Skip to content

Trace

What an agent did, step by step: thoughts, tool calls and results, each with a status icon, how long it took and details you can open. Same markup and props in every style: switch the style in the header to see it change.

Basic

A thought, two tool calls (one open) and the answer being written.

  1. Worked out what to look for Thought · 2s
  2. Searched the web Tool call · 1.2s
    web_search({ query: "easy hiking trails near Denver" })

    Found 8 results.

  3. Read 3 pages Tool call · 3.4s

    alltrails.com, coloradotrailexplorer.org, denvergov.org

  4. Writing the answer Result · 4s
trace-basic.html
<ol class="vin-trace" aria-label="Agent steps" style="max-width: 520px">
  <li class="vin-trace__step">
    <span class="vin-trace__icon" role="img" aria-label="Done"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m5 12.5 4.5 4.5L19 7.5"/></svg></span>
    <div class="vin-trace__head">
      <span class="vin-trace__title">Worked out what to look for</span>
      <span class="vin-trace__meta">Thought · 2s</span>
    </div>
  </li>
  <li class="vin-trace__step">
    <span class="vin-trace__icon" role="img" aria-label="Done"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m5 12.5 4.5 4.5L19 7.5"/></svg></span>
    <details class="vin-collapsible vin-trace__details" open>
      <summary class="vin-collapsible__trigger vin-trace__head">
        <span class="vin-trace__title">Searched the web</span>
        <span class="vin-trace__meta">Tool call · 1.2s</span>
      </summary>
      <div class="vin-collapsible__content vin-trace__body">
        <pre class="vin-trace__code">web_search({ query: "easy hiking trails near Denver" })</pre>
        <p>Found 8 results.</p>
      </div>
    </details>
  </li>
  <li class="vin-trace__step">
    <span class="vin-trace__icon" role="img" aria-label="Done"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m5 12.5 4.5 4.5L19 7.5"/></svg></span>
    <details class="vin-collapsible vin-trace__details">
      <summary class="vin-collapsible__trigger vin-trace__head">
        <span class="vin-trace__title">Read 3 pages</span>
        <span class="vin-trace__meta">Tool call · 3.4s</span>
      </summary>
      <div class="vin-collapsible__content vin-trace__body">
        <p>alltrails.com, coloradotrailexplorer.org, denvergov.org</p>
      </div>
    </details>
  </li>
  <li class="vin-trace__step vin-trace__step--running">
    <span class="vin-trace__icon" role="img" aria-label="Running"><span class="vin-spinner vin-spinner--sm" aria-hidden="true"></span></span>
    <div class="vin-trace__head">
      <span class="vin-trace__title">Writing the answer</span>
      <span class="vin-trace__meta">Result · 4s</span>
    </div>
  </li>
</ol>

Failed step

A tool call that failed, with the error in its details, and a step that hasn't started.

  1. Drafted the email Result · 3s
  2. Looked up the contact Failed · 0.8s
    contacts.find({ name: "Grace" })
    Error 403: the contacts app isn't connected.
  3. Send the email Tool call
trace-error.html
<ol class="vin-trace" aria-label="Agent steps" style="max-width: 520px">
  <li class="vin-trace__step">
    <span class="vin-trace__icon" role="img" aria-label="Done"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m5 12.5 4.5 4.5L19 7.5"/></svg></span>
    <div class="vin-trace__head">
      <span class="vin-trace__title">Drafted the email</span>
      <span class="vin-trace__meta">Result · 3s</span>
    </div>
  </li>
  <li class="vin-trace__step vin-trace__step--error">
    <span class="vin-trace__icon" role="img" aria-label="Failed"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M17 7 7 17"/><path d="m7 7 10 10"/></svg></span>
    <details class="vin-collapsible vin-trace__details" open>
      <summary class="vin-collapsible__trigger vin-trace__head">
        <span class="vin-trace__title">Looked up the contact</span>
        <span class="vin-trace__meta">Failed · 0.8s</span>
      </summary>
      <div class="vin-collapsible__content vin-trace__body">
        <pre class="vin-trace__code">contacts.find({ name: "Grace" })
Error 403: the contacts app isn't connected.</pre>
      </div>
    </details>
  </li>
  <li class="vin-trace__step vin-trace__step--pending">
    <span class="vin-trace__icon" role="img" aria-label="Not started"></span>
    <div class="vin-trace__head">
      <span class="vin-trace__title">Send the email</span>
      <span class="vin-trace__meta">Tool call</span>
    </div>
  </li>
</ol>

Folded away

The whole trace inside a Collapsible, as "Worked for 9s", so the reply stays short.

Worked for 9s · 3 steps
  1. Opened sales-q3.csv Tool call · 0.4s
  2. Ran a Python script Tool call · 6.1s
    df.groupby("region")["revenue"].sum()
  3. Made a chart of revenue by region Result · 2.5s
trace-grouped.html
<details class="vin-collapsible" open style="width: 100%; max-width: 520px">
  <summary class="vin-collapsible__trigger">Worked for 9s · 3 steps</summary>
  <div class="vin-collapsible__content">
    <ol class="vin-trace" aria-label="Agent steps">
      <li class="vin-trace__step">
        <span class="vin-trace__icon" role="img" aria-label="Done"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m5 12.5 4.5 4.5L19 7.5"/></svg></span>
        <div class="vin-trace__head">
          <span class="vin-trace__title">Opened sales-q3.csv</span>
          <span class="vin-trace__meta">Tool call · 0.4s</span>
        </div>
      </li>
      <li class="vin-trace__step">
        <span class="vin-trace__icon" role="img" aria-label="Done"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m5 12.5 4.5 4.5L19 7.5"/></svg></span>
        <details class="vin-collapsible vin-trace__details">
          <summary class="vin-collapsible__trigger vin-trace__head">
            <span class="vin-trace__title">Ran a Python script</span>
            <span class="vin-trace__meta">Tool call · 6.1s</span>
          </summary>
          <div class="vin-collapsible__content vin-trace__body">
            <pre class="vin-trace__code">df.groupby("region")["revenue"].sum()</pre>
          </div>
        </details>
      </li>
      <li class="vin-trace__step">
        <span class="vin-trace__icon" role="img" aria-label="Done"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m5 12.5 4.5 4.5L19 7.5"/></svg></span>
        <div class="vin-trace__head">
          <span class="vin-trace__title">Made a chart of revenue by region</span>
          <span class="vin-trace__meta">Result · 2.5s</span>
        </div>
      </li>
    </ol>
  </div>
</details>

Installation

React, Vue and Svelte: add the component to your project with the CLI. It reads your framework from vin.json and also copies any component this one needs. Then import it:

Terminal
npx @vinish/ui add trace
React
import { Trace, TraceStep } from "@/components/vin/trace";
Vue
import Trace, { TraceStep } from "@/components/vin/trace.vue";
Svelte
import Trace from "$lib/components/vin/trace.svelte";
import TraceStep from "$lib/components/vin/trace-step.svelte";

The import paths assume the default folders: @/components/vin (React and Vue, with the usual @ → src alias) and $lib/components/vin (SvelteKit). Use your own if you chose another folder in init. How the Vue and Svelte versions pass values and content is in Frameworks.

Plain HTML: the classes come with the style's stylesheet. It needs no JavaScript.

API

From spec/trace.json, which every framework version is tested against.

PropValuesDefaultIn HTML
Trace
The ordered list of steps. label names it (default "Agent steps").
children—ol.vin-trace[aria-label]
TraceStep
One step.
component—li.vin-trace__step
status
A check, a spinner, a cross or an empty dashed circle.
donerunningerrorpendingdonevin-trace__step--{value}
title
What happened, e.g. "Searched the web".
ReactNode—.vin-trace__title
kind / duration
Shown as "Tool call · 1.2s" at the end of the row.
string—.vin-trace__meta
meta
Your own text instead of kind and duration.
ReactNode——
children
Details: the step opens and closes like a Collapsible. Put code in pre.vin-trace__code.
ReactNode—details.vin-collapsible.vin-trace__details > summary.vin-collapsible__trigger.vin-trace__head + .vin-collapsible__content.vin-trace__body
open / defaultOpen
With details. Use onOpenChange to hear about changes.
boolean——

Parts

React, Vue, SvelteHTML classes
<Trace><TraceStep>.vin-trace.vin-trace__step.vin-trace__step--running.vin-trace__step--error.vin-trace__step--pending.vin-trace__icon.vin-trace__details.vin-trace__head.vin-trace__title.vin-trace__meta.vin-trace__body.vin-trace__code

Accessibility

  • The steps are an ordered list, so screen readers say how many there are and where each one is.
  • Each status icon is an image with a name ("Done", "Running", "Failed", "Not started"); colour is never the only signal.
  • Details use the native <details> element: they open with Enter or Space and screen readers say whether they are expanded. No JavaScript is needed.
  • The spinner slows down when the reader prefers reduced motion. If you update a trace live, announce the important changes (for example with a StatusMarker) rather than every step.