The tools an AI assistant used to get its answer, step by step: their status, how long they took, and their input and output.
$ pnpm dlx shadcn@latest add https://dashral.com/r/tool-activity.jsonInstallation
$ pnpm dlx shadcn@latest add https://dashral.com/r/tool-activity.jsonAdds the component, the components it builds on, its npm packages and the theme tokens it uses. Using Dashral often? Add the registry to components.json once:
{
"registries": {
"@dashral": "https://dashral.com/r/{name}.json"
}
}Then add components by name:
$ pnpm dlx shadcn@latest add @dashral/tool-activityUsage
import { ToolActivity } from "@/components/dashral/tool-activity"
<ToolActivity
steps={[
{ name: "Search orders", status: "done", duration: 820, output: { found: 96 } },
{ name: "Sum revenue", status: "running" },
]}
/>Examples
Every state
Done (opened to its input and output), failed with the reason, running and waiting.
- Read invoice #1042: DoneInput
{ "invoice": "INV-1042" }Output{ "customer": "Northwind", "amount": 1240, "currency": "USD", "due": "2026-10-02", "paid": false } - Send a payment reminder: Failed
- Look up the new billing contact: RunningLook up the new billing contact
- Send the reminder again: WaitingSend the reminder again
API reference
ToolActivity
Also takes every prop of <ol>(opens in a new tab).
| Prop | Type | Default |
|---|---|---|
steps | ToolStep[]The tool calls in the order they ran. Required. | — |
aria-label | stringNames the list. | "Tool activity" |
classNames | { step?, trigger?, details?, code? }Classes for each part. | — |
className | stringExtra classes, merged with cn() so yours win. | — |
ToolStep
| Prop | Type | Default |
|---|---|---|
name | ReactNodeWhat the tool did, in words. Required. | — |
status | "pending" | "running" | "done" | "error"Required. Shown as an icon and heard as a word. | — |
description | ReactNodeA line under the name: what it found, or why it failed. | — |
input / output | unknownObjects show as JSON, text as it is, an element rendered. Either one makes the step open. | — |
duration | numberMilliseconds, written in the locale's units (820 ms, 1.2 s). | — |
icon | ReactNodeReplaces the status icon. | — |
defaultOpen | booleanOpen to its input and output from the start. | false |
id | stringA stable key when names repeat. | — |
Keyboard
| Keys | Action |
|---|---|
| Tab | The steps with details |
| EnterorSpace | Open or fold a step's input and output |
Accessibility
- An ordered list, named Tool activity; each step's status is a word as well as an icon and a color.
- As a step changes, a polite live region says it ("Search orders: done"), not the whole list again.
- A step with details is a button that says whether it's open (aria-expanded).
Motion
- A running step's spinner turns, and stands still with reduced motion. Details open and fold over --duration-standard.