Tool call
Shows a tool call and its status, and expands to show the input and output.
Input
{ "query": "disclosure expansion" }Output
Disclosure supports controlled and default expanded state.
tool-call-demo.tsx
Installation
The CLI adds the files, packages, theme variables, and Tailwind plugin that this component uses. Before you run it, set up your project.
npm
yarn
pnpm
bun
Composition
ToolCallOwns the expanded state. Accepts isExpanded, defaultExpanded, and onExpandedChange.
ToolCallTriggerToolCallPanelToolCallSectionOptionalRepeatsToolCallCodeOptional
States
Screen readers announce each change.
Waiting for a response.
tool-call-states-demo.tsx
Sequence
tool-call-sequence-demo.tsx
API reference
vip/ui adds or changes the props below. For all other props, see React Aria Disclosure (opens in a new tab).
ToolCallTrigger
- name: stringRequired
- The tool name.
- status: "running" | "complete" | "error"Required
- Sets the icon and the status text. A change crossfades both. Running pulses unless reduced motion is on. Screen readers announce changes.
- summary: string
- Short text below the name.
ToolCallSection
- label: stringRequired
- Heading above the section, such as Input or Output.