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.
-
Worked out what to look for
-
Searched the web
web_search({ query: "easy hiking trails near Denver" })Found 8 results.
-
Read 3 pages
alltrails.com, coloradotrailexplorer.org, denvergov.org
-
Writing the answer
<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>- Worked out what to look for
Searched the web
web_search({ query: "easy hiking trails near Denver" })Found 8 results.
Read 3 pages
alltrails.com, coloradotrailexplorer.org, denvergov.org
- Writing the answer
import { Trace, TraceStep } from "@/components/vin/trace";
export function TraceBasic() {
return (
<Trace style={{ maxWidth: 520 }}>
<TraceStep title="Worked out what to look for" kind="Thought" duration="2s" />
<TraceStep title="Searched the web" kind="Tool call" duration="1.2s" defaultOpen>
<pre className="vin-trace__code">{'web_search({ query: "easy hiking trails near Denver" })'}</pre>
<p>Found 8 results.</p>
</TraceStep>
<TraceStep title="Read 3 pages" kind="Tool call" duration="3.4s">
<p>alltrails.com, coloradotrailexplorer.org, denvergov.org</p>
</TraceStep>
<TraceStep status="running" title="Writing the answer" kind="Result" duration="4s" />
</Trace>
);
}The Vue version renders the same markup as the HTML tab, so it looks and works the same.
<script setup lang="ts">
import Trace, { TraceStep } from "@/components/vin/trace.vue";
</script>
<template>
<Trace style="max-width: 520px">
<TraceStep title="Worked out what to look for" kind="Thought" duration="2s" />
<TraceStep title="Searched the web" kind="Tool call" duration="1.2s" default-open>
<pre class="vin-trace__code">web_search({ query: "easy hiking trails near Denver" })</pre>
<p>Found 8 results.</p>
</TraceStep>
<TraceStep title="Read 3 pages" kind="Tool call" duration="3.4s">
<p>alltrails.com, coloradotrailexplorer.org, denvergov.org</p>
</TraceStep>
<TraceStep status="running" title="Writing the answer" kind="Result" duration="4s" />
</Trace>
</template>The Svelte version renders the same markup as the HTML tab, so it looks and works the same.
<script lang="ts">
import Trace from "$lib/components/vin/trace.svelte";
import TraceStep from "$lib/components/vin/trace-step.svelte";
</script>
<Trace style="max-width: 520px">
<TraceStep title="Worked out what to look for" kind="Thought" duration="2s" />
<TraceStep title="Searched the web" kind="Tool call" duration="1.2s" open>
<pre class="vin-trace__code">{'web_search({ query: "easy hiking trails near Denver" })'}</pre>
<p>Found 8 results.</p>
</TraceStep>
<TraceStep title="Read 3 pages" kind="Tool call" duration="3.4s">
<p>alltrails.com, coloradotrailexplorer.org, denvergov.org</p>
</TraceStep>
<TraceStep status="running" title="Writing the answer" kind="Result" duration="4s" />
</Trace>Failed step
A tool call that failed, with the error in its details, and a step that hasn't started.
-
Drafted the email
-
Looked up the contact
contacts.find({ name: "Grace" }) Error 403: the contacts app isn't connected. -
Send the email
<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>- Drafted the email
Looked up the contact
contacts.find({ name: "Grace" }) Error 403: the contacts app isn't connected.- Send the email
import { Trace, TraceStep } from "@/components/vin/trace";
export function TraceError() {
return (
<Trace style={{ maxWidth: 520 }}>
<TraceStep title="Drafted the email" kind="Result" duration="3s" />
<TraceStep status="error" title="Looked up the contact" kind="Failed" duration="0.8s" defaultOpen>
<pre className="vin-trace__code">{'contacts.find({ name: "Grace" })\nError 403: the contacts app isn\'t connected.'}</pre>
</TraceStep>
<TraceStep status="pending" title="Send the email" kind="Tool call" />
</Trace>
);
}The Vue version renders the same markup as the HTML tab, so it looks and works the same.
<script setup lang="ts">
import Trace, { TraceStep } from "@/components/vin/trace.vue";
const code = 'contacts.find({ name: "Grace" })\nError 403: the contacts app isn\'t connected.';
</script>
<template>
<Trace style="max-width: 520px">
<TraceStep title="Drafted the email" kind="Result" duration="3s" />
<TraceStep status="error" title="Looked up the contact" kind="Failed" duration="0.8s" default-open>
<pre class="vin-trace__code">{{ code }}</pre>
</TraceStep>
<TraceStep status="pending" title="Send the email" kind="Tool call" />
</Trace>
</template>The Svelte version renders the same markup as the HTML tab, so it looks and works the same.
<script lang="ts">
import Trace from "$lib/components/vin/trace.svelte";
import TraceStep from "$lib/components/vin/trace-step.svelte";
</script>
<Trace style="max-width: 520px">
<TraceStep title="Drafted the email" kind="Result" duration="3s" />
<TraceStep status="error" title="Looked up the contact" kind="Failed" duration="0.8s" open>
<pre class="vin-trace__code">{'contacts.find({ name: "Grace" })\nError 403: the contacts app isn\'t connected.'}</pre>
</TraceStep>
<TraceStep status="pending" title="Send the email" kind="Tool call" />
</Trace>Folded away
The whole trace inside a Collapsible, as "Worked for 9s", so the reply stays short.
Worked for 9s · 3 steps
-
Opened sales-q3.csv
-
Ran a Python script
df.groupby("region")["revenue"].sum() -
Made a chart of revenue by region
<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>Worked for 9s · 3 steps
- Opened sales-q3.csv
Ran a Python script
df.groupby("region")["revenue"].sum()- Made a chart of revenue by region
import { Trace, TraceStep } from "@/components/vin/trace";
import { Collapsible } from "@/components/vin/collapsible";
export function TraceGrouped() {
return (
<Collapsible trigger="Worked for 9s · 3 steps" defaultOpen style={{ width: "100%", maxWidth: 520 }}>
<Trace>
<TraceStep title="Opened sales-q3.csv" kind="Tool call" duration="0.4s" />
<TraceStep title="Ran a Python script" kind="Tool call" duration="6.1s">
<pre className="vin-trace__code">{'df.groupby("region")["revenue"].sum()'}</pre>
</TraceStep>
<TraceStep title="Made a chart of revenue by region" kind="Result" duration="2.5s" />
</Trace>
</Collapsible>
);
}The Vue version renders the same markup as the HTML tab, so it looks and works the same.
<script setup lang="ts">
import Trace, { TraceStep } from "@/components/vin/trace.vue";
import Collapsible from "@/components/vin/collapsible.vue";
</script>
<template>
<Collapsible trigger="Worked for 9s · 3 steps" default-open style="width: 100%; max-width: 520px">
<Trace>
<TraceStep title="Opened sales-q3.csv" kind="Tool call" duration="0.4s" />
<TraceStep title="Ran a Python script" kind="Tool call" duration="6.1s">
<pre class="vin-trace__code">df.groupby("region")["revenue"].sum()</pre>
</TraceStep>
<TraceStep title="Made a chart of revenue by region" kind="Result" duration="2.5s" />
</Trace>
</Collapsible>
</template>The Svelte version renders the same markup as the HTML tab, so it looks and works the same.
<script lang="ts">
import Trace from "$lib/components/vin/trace.svelte";
import TraceStep from "$lib/components/vin/trace-step.svelte";
import Collapsible from "$lib/components/vin/collapsible.svelte";
</script>
<Collapsible trigger="Worked for 9s · 3 steps" open style="width: 100%; max-width: 520px">
<Trace>
<TraceStep title="Opened sales-q3.csv" kind="Tool call" duration="0.4s" />
<TraceStep title="Ran a Python script" kind="Tool call" duration="6.1s">
<pre class="vin-trace__code">{'df.groupby("region")["revenue"].sum()'}</pre>
</TraceStep>
<TraceStep title="Made a chart of revenue by region" kind="Result" duration="2.5s" />
</Trace>
</Collapsible>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:
npx @vinish/ui add traceimport { Trace, TraceStep } from "@/components/vin/trace";import Trace, { TraceStep } from "@/components/vin/trace.vue";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.
| Prop | Values | Default | In HTML |
|---|---|---|---|
TraceThe ordered list of steps. label names it (default "Agent steps"). | children | — | ol.vin-trace[aria-label] |
TraceStepOne step. | component | — | li.vin-trace__step |
statusA check, a spinner, a cross or an empty dashed circle. | donerunningerrorpending | done | vin-trace__step--{value} |
titleWhat happened, e.g. "Searched the web". | ReactNode | — | .vin-trace__title |
kind / durationShown as "Tool call · 1.2s" at the end of the row. | string | — | .vin-trace__meta |
metaYour own text instead of kind and duration. | ReactNode | — | — |
childrenDetails: 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 / defaultOpenWith details. Use onOpenChange to hear about changes. | boolean | — | — |
Parts
| React, Vue, Svelte | HTML 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.
Customize
Saved in this browser. Style and accent are in the header.