Tool Call
One tool invocation with a status lamp, live timer, arguments, result and Approve/Deny. Groups into a run log.
New in 1.6.Built on Code Block and Icons.
Installation
npx shadcn@latest add https://neonkit.heyaadi.com/r/tool-call.jsonUsage
import { ToolCall, ToolCallGroup } from "@/components/ui/tool-call"
<ToolCallGroup label="Run log">
<ToolCall name="read_file" args={{ path: "src/date.ts" }} status="success" duration={0.1} result={source} />
<ToolCall name="edit_file" summary="src/date.ts" status="approval" onApprove={run} onDeny={skip} />
</ToolCallGroup>Examples
Approval
A tool that needs permission opens with its arguments and a note on what it will do. The amber lamp breathes until you decide; Approve is the one lit thing on the row.
Every status
Success, error with its message, running, queued and denied, stacked in one group. Readouts stay in one column.
Custom results
result takes any node. Here a SQL query returns a table, and summary replaces the raw arguments with what the query is for.
API reference
ToolCall
One invocation. The row is a disclosure when there is anything to show.
| Prop | Type | Default |
|---|---|---|
name | stringThe tool's name, in mono. | None |
args | Record<string, unknown>Shown as a key/value list when open. One string argument doubles as the summary. | None |
summary | ReactNodeReplaces the one-line argument summary. | None |
status | "pending"Drives the lamp, the readout and the border. "done" is accepted as success. | "success" |
duration | numberSeconds. While running, a live timer counts up when omitted. | None |
meta | ReactNodeReplaces the duration, e.g. "14 passed" or "exit 1". | None |
result | ReactNodeShown when open. Strings render as code. | None |
resultLanguage | stringLanguage for a string result. | None |
error | ReactNodeShown under the row when status is error. | None |
children | ReactNodeExtra detail in the panel before the result, such as a diff preview. | None |
approvalNote | ReactNodeWith status approval: what running it will do. | None |
onApprove / onDeny | () => voidThe approval buttons. Set status yourself from them. | None |
approveLabel / denyLabel | stringButton text, e.g. "Run on prod". | "Approve" / "Deny" |
open / defaultOpen / onOpenChange | boolean / boolean / (open) => voidDisclosure state. A call waiting for approval is always open. | None |
color | NeonColorPalette name or hex. Approval is always amber and errors red. | inherited |
ToolCallGroup
An ordered list that joins its calls into one panel, like lines in a log.
| Prop | Type | Default |
|---|---|---|
label | stringAccessible name of the list. | "Tool calls" |
color | NeonColorPassed down to every call. | inherited |
Accessibility
- Each status is spoken as a word after the tool name, and status changes are announced through a polite live region. The ticking timer is never announced.
- Approve and Deny are plain buttons in reading order after the arguments, so the decision follows what it's about.
- Under prefers-reduced-motion the running lamp holds steady and the approval lamp stops breathing.