ToolCallCard
An agent's tool call as one collapsible row. The status swaps between a spinner, a tick and a warning, the run time lands when it finishes, and opening shows the input and the result. AI.
Open playgroundAbout
ToolCallCard is a React component in the AI category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { ToolCallCard } from "@ashutoshswamy/smoui" and set name, status, input among its 6 props.
Install
npm i @ashutoshswamy/smouiUsage
import { ToolCallCard } from "@ashutoshswamy/smoui";
<ToolCallCard
name="search_orders"
status="done"
input={{ customer_id: "cus_8Hq2", limit: 3 }}
output={{ count: 3 }}
durationMs={1840}
/>Props 6
- name
The function the model called.
string- status
Sets the icon and the summary line.
"running""done""error"- input / output
Objects print as formatted JSON.
unknown / ReactNode- error
Shown instead of the output when status is error.
string- durationMs
Run time, shown once it has finished.
number- defaultOpen
Start expanded.
booleandefaultfalse
More ai components
- AgentPickerChoose which agent takes the job. Cards show purpose, tools and cost; a marker slides between them and arrow keys move.
- AgentStatusPillOne pill for what an agent is doing: ready, thinking, using a tool, waiting on you or failed. The glyph and width morph between states.
- AgentTraceA run as a waterfall. Spans nest under the step that started them, bars sit at their real start and length, parents fold away children.
- AiOrbA living orb for voice and agent states: breathes, swells with sound, turns while thinking.
- ApprovalGateAn agent asks before it runs a tool. Review the input, edit it, approve once or always, or deny; the card settles into its decision.
- AttachmentChipA file waiting to be sent. A ring fills around the tile while it uploads, a warning and a Retry button replace it on failure, and remove sits inside the chip.