ZUI

Search documentation

Find a page or a heading.

Tool Call Card

One tool invocation in a chat transcript: a trigger row over collapsible sections, whose status badge follows the call's lifecycle state.

tsx

Installation

bash

Usage

tsx
tsx

The host maps its own dispatcher lifecycle onto state. Use it for a tool invocation whose status the assistant reports; for a consent request the visitor must decide, use Permission Card instead.

Composition

text

Error state

tsx

state="output-error" turns the status badge's icon into a cross; the host supplies the failure's own text inside a ToolCallCardSection.

API reference

ToolCallCard

Renders shadcn's Collapsible, as a small Card, and takes every prop Collapsible takes, plus:

It sets data-slot="tool-call-card" and data-state to its state.

ToolCallCardTrigger

Renders shadcn's CollapsibleTrigger, as a full-width, left-justified, link Button, and takes every prop CollapsibleTrigger takes. Appends a chevron that turns over while the sections are open, drawing the same open or closed, and plays - along with any ToolCallCardStatus icon inside it - while the trigger is hovered or focused; a caller's own pointer and focus handlers still run. It sets data-slot="tool-call-card-trigger".

ToolCallCardTitle

Renders a span and takes every prop a span takes. The tool's name, kept whole while ToolCallCardDescription beside it truncates. It sets data-slot="tool-call-card-title".

ToolCallCardDescription

Renders a span and takes every prop a span takes. A one-line summary of the call, truncated to the row. It sets data-slot="tool-call-card-description".

ToolCallCardStatus

Renders shadcn's Badge, as a span, and takes every prop a span takes. Its icon - a circle for input-streaming, a clock for input-available, a check for output-available, a cross for output-error - follows the root's state, and children are the status word. Inside a ToolCallCardTrigger its clock and check play while the trigger is hovered or focused; anywhere else they hold still. It sets data-slot="tool-call-card-status".

ToolCallCardContent

Renders shadcn's CollapsibleContent, as a CardContent, and takes every prop CollapsibleContent takes. The sections under the trigger, in a vertical stack; unmounted while closed. It sets data-slot="tool-call-card-content".

ToolCallCardSection

Renders a div and takes every prop a div takes. One labelled block of the call, such as its parameters, its result or its error. It sets data-slot="tool-call-card-section".

ToolCallCardSectionTitle

Renders an h4 and takes every prop an h4 takes. A section's small muted heading, such as Parameters or Result. It sets data-slot="tool-call-card-section-title".