Skip to content
uifiles
Browse components
AgentComponent

Confirmation

Human-in-the-loop approval prompt for AI tool calls, rendered as an Alert. Reads the tool part's state and approval object and shows exactly one of: the pending request with Approve/Reject action buttons (approval-requested), the accepted outcome (approval-responded, output-available or output-error with approved: true), or the rejected outcome (approval-responded or output-denied with approved: false); renders nothing while input is streaming, before an approval exists, or when a responded part carries no decision. Use it with useChat addToolApprovalResponse for tools that require user consent.

pnpm dlx shadcn@latest add @uifiles/confirmation
Installs with

Awaiting a decision

approval-requested: approve or reject, then reset to ask again.

Approved

output-available after an approval.

Approved, then failed

output-error after an approval: the tool ran and failed.

Rejected

output-denied with the reason the person gave.