← All components
Interaction / component

Tool Run Card

A compact tool disclosure with captured parameters, explicit approval and inspectable local results.

PLAYGROUND
Live preview
Preparing preview…

Take it with you.

SOURCE ACCESS

Preview freely. Unlock the files.

Enter the shared password to copy the complete source, download every file, and install components in your app.

Access lasts 24 hours. Your preview settings stay with you.

Component notes

  • Portable derivative preserving the compact Tool/status/disclosure and Parameters/Result hierarchy. Replaces upstream monorepo, AI SDK, icons and code renderer with complete scoped native React/CSS.
  • Primitive callbacks are caller-owned. Undefined output alone is absent; values are inert text, bounded to depth 8, 500 nodes and 12,000 characters. Getters and toJSON are not invoked; hostile inspection is caught.
  • Local example starts with editable black/white colors and Request check. Approve calculates real WCAG contrast with a 4.5:1 normal-text target; Deny performs no calculation. Retry captures corrected inputs.
  • Captured input/run identity guards cancel, edit, stale and duplicate approval. State study is appearance only. Tabs, Pause and Replay preserve work; status changes cancel unfinished work. Reset restores the selected preset/mode.
  • All states are static and remain usable under reduced motion, hidden documents and paused playback. No implicit network or backend requests.
React 19.2Modern browsersNative disclosure

AI Elements — Vercel, Inc. · Apache-2.0. Portable derivative; original copyright notice and full license included.

Props

PropTypeDefaultDescription
titlestring'Tool run'Disclosure title.
state'pending' | 'approval-requested' | 'running' | 'complete' | 'error' | 'denied' | 'cancelled''pending'Appearance state; caller owns real task progression.
inputunknownundefinedCaptured parameters rendered as bounded inert text.
outputunknownundefinedResult value; 0, false and null remain meaningful.
errorTextstringundefinedReadable error message.
openbooleanundefinedControlled disclosure; omit for internal state.
onOpenChange(open: boolean) => voidundefinedReceives native disclosure changes.
disabledbooleanfalseDisables disclosure and every action callback.
pausedbooleanfalseStatic design preserves content and interactions.
replayTokennumber0Accepted playback input; static disclosure and results are preserved.
classNamestring''Additional host class.
onApprove() => voidundefinedCaller-owned approve action; only displayed in an applicable state.
onDeny() => voidundefinedCaller-owned deny action; only displayed in an applicable state.
onCancel() => voidundefinedCaller-owned cancel action; only displayed in an applicable state.
onRetry() => voidundefinedCaller-owned retry action; only displayed in an applicable state.