Skip to content

No.239 · AI & Chat

Tool Call

An assistant's tool use shown as it happens: each call is a card with its arguments, a shimmering status while it runs, and a collapsible result.

The prompt

Copy this text

Automatic copying is unavailable. Copy the selected text using your device’s copy command.

Written for the variant you picked above: Paper

Build a timeline of an assistant calling tools. Each step is a card that appears when its call starts (fade and rise 6px): a small status square — a spinner while running, a green tick when done — the function name in mono accent with its arguments inline as key: "value" pairs (ellipsised if long), and on the right a status that shimmers ("Running…", a moving gradient clipped to the text) and then becomes the result summary ("6 flights", "Held until 15:42"). Calls run in sequence, each with its own duration. Finished cards expand (aria-expanded, grid-template-rows 0fr → 1fr, chevron rotates) to show the full arguments as pretty JSON and any detail lines. When the last call finishes, the assistant's answer fades in below, and the footer reports "3 tool calls · 3.9s" with a Run again button. On narrow screens the status column hides. Selected variant — Paper (paper): Apply the paper theme. Where the brief above gives no colour values for it, choose a restrained paper palette with text at 4.5:1 contrast or better. Keep the geometry, states and motion described above unchanged. This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: Calls run on their own; expand a finished call to see its arguments and details, or run the whole sequence again. Motion: Card entry 420ms; spinner 700ms; shimmer 1.4s; expand 320ms; answer fade 400ms. Accessibility: An ordered list of calls; each header is a button with aria-expanded once it's done. The final answer is announced politely. Reduced motion shows every call finished. Responsive behavior: A card up to about 40rem wide that fills narrower screens; dense rows and side columns stack on phones. Touch: Everything is tap-driven; hover hints have tap or focus equivalents. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.

Notes

Interaction
Calls run on their own; expand a finished call to see its arguments and details, or run the whole sequence again.
Motion
Card entry 420ms; spinner 700ms; shimmer 1.4s; expand 320ms; answer fade 400ms.
Accessibility
An ordered list of calls; each header is a button with aria-expanded once it's done. The final answer is announced politely. Reduced motion shows every call finished.
Responsive
A card up to about 40rem wide that fills narrower screens; dense rows and side columns stack on phones.
On touch
Everything is tap-driven; hover hints have tap or focus equivalents.