uimaxxer

Tool call

The JSON unfolds as it streams. Keys arrive as a tree, an object opens as its brace arrives and closes when it ends, and strings type in place, so you watch the structure form instead of a wall of text.

npx shadcn@latest add @uimaxxer/tool-call
Pro
PasskeysFix the duplicate Stripe charge

Fix the rounding in totalFor() so 0.005 goes to the even cent.

Captain

read_file finished
run failed
edit_file()

Usage

import { ToolCall } from "@/components/ui/tool-call"

<ToolCall
  name="edit_file"
  title="Editing billing/invoice.ts"
  status="running"
  startedAt={call.startedAt}
  args={call.partialJson}
/>

Props

PropTypeDefaultWhat it does
namestringThe tool's name, e.g. edit_file.
titleReactNodeWhat it is doing, in words.
status"running" | "success" | "error"Running shimmers and counts; the others settle on a glyph.
argsobject | stringAn object, or a partial JSON string while it streams. Parsed tolerantly and drawn as a tree either way.
resultunknownShown as highlighted JSON on success.
errorReactNodeShown in the danger colour on error.
startedAtnumberms since epoch; drives the live clock.
durationnumberFinal duration in ms.
elapsednumberms shown on the clock instead of a live count, for replays.
open / defaultOpenbooleanExpanded state.

Keyboard

Enter / Space
Open or close

Accessibility

  • The row is a button with aria-expanded and aria-controls.
  • Finishing or failing is announced in a polite live region.
  • Under reduced motion the shimmer and spinner stop and rows appear without unfolding; the text and clock remain.
  • The parser never throws: a cut mid-key, mid-escape or mid-number shows what has arrived.