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 playground
Input
{
  "customer_id": "cus_8Hq2",
  "status": "shipped",
  "limit": 3
}
Waiting for a result

About

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

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
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.

booleandefault false