AIComponentBeta

Tool.

What the model called, and what came back.

A tool call as a collapsed card: the tool's name and a state badge, with the input, output or error inside. States match the AI SDK's tool part states.

Make it yours

Preparing the example…

PROPERTIES2

Composition

Anatomy

Objects are shown as formatted JSON; pass an element to render a richer result. Override badge text with stateLabels, for example Cancelled for a stopped call.

Component structure
Tool.Root — Collapsible.Root
├── Tool.Header (name, state, stateLabels) — trigger + Badge
└── Tool.Content — Collapsible.Panel
    ├── Tool.Input — JSON
    ├── Tool.Output — JSON or a React element
    └── Tool.Error

A place to start

Usage

Import the stylesheet once at your application root. This complete example reflects the properties selected above.

Loading example…

Details that make a difference

Examples & states

States

Compare enabled and disabled navigation.

Example loads as it comes into view.

Loading source…

The finer details

API reference

Generated from Dixy’s local TypeScript interfaces. Native and Base UI Collapsible props are forwarded; this table covers the options Dixy adds.

ToolHeader

PropType / descriptionDefault
name*ReactNode

The tool's name, e.g. "get_weather".

—
state*"input-streaming" | "input-available" | "approval-requested" | "approval-responded" | "output-available" | "output-error" | "output-denied"

Lifecycle state, using the AI SDK's tool part states.

—
stateLabelsPartial<Record<ToolState, string>>

Override the state badge's text, e.g. for localisation.

—
iconReactNode

Replace the leading icon.

—

ToolSection

PropType / descriptionDefault
childrenunknown

Shown as formatted JSON unless it is already a string or element.

—
titleReactNode

Section heading.

—
Explore the full Base UI API

Built from the same foundations

Styling tokens

Change Theme settings above to compare appearance, accent, neutral, radius, spacing density, motion and direction. Override component aliases on a Theme root so custom properties follow portaled content too. The wrapper merges className, style, refs and render composition with its owning primitive.

TokenPurpose
--dixy-color-background-action-destructive-subtleThe component-specific starting point.
--dixy-font-label-mdControl label font and line height; body roles remain readable in text inputs.
--dixy-color-background-selectedSelected surfaces use semantic color across appearances.
--dixy-color-border-focusFocus indication remains visible independently of shadows.
--dixy-spacing-inset-smDensity-aware component padding.
--dixy-motion-transition-feedbackShort state feedback, reduced by the inherited motion setting.
Explore theme customization

Consider everyone

Accessibility

The state is text in a badge, not color alone, and it is part of the trigger's accessible name. Errors are not alerts: the panel mounts when the reader opens it, and the badge already reports the failure.

Enter / SpaceShow or hide the call's details.

Target: WCAG 2.2 AA. Automated tests cover selected behavior; manual screen-reader, contrast, and zoom validation remain part of the release checklist.

THE THINKING BEHIND IT

Build it. Then understand it.

An alert inside a disclosure fires when the reader opens it, which is exactly when they least need interrupting. Report state where it is first seen.

A token to follow--dixy-color-background-action-destructive-subtle

Nothing up our sleeves

Source
UP NEXTSources