AI-06AIUpdated, November 16, 2026
AI Tool Approval
Approve or deny an agent's tool calls. Destructive calls need a press and hold, and decided calls fold into a trace with their output.
PROSlash Command Menu and more like it are in Kokonut UI Pro
Installation
AI Tool Approval is a free, open-source React component in the Kokonut UI AI collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/ai-tool-approval.tsx, so the code is yours to change.
npx shadcn@latest add @kokonutui/ai-tool-approvalOr add it by hand: install its packages, then copy the source from Copy code above into components/kokonutui/ai-tool-approval.tsx.
npm install lucide-react motionUsage
import AIToolApproval from "@/components/kokonutui/ai-tool-approval";
export default function Example() {
return <AIToolApproval />;
}Props
callsToolCall[]The conversation's tool calls, oldest first. When omitted, a demo run plays with three calls to approve.
onRespond(id: string, approved: boolean, always: boolean) => voidCalled when the user allows or denies a call. always is true when they chose to stop asking for this tool.
classNamestringExtra classes for the root element.
ToolCall
idrequiredstringtoolrequiredstringThe tool's name, such as bash or write_file. Picks the icon.
titlerequiredstringWhat the agent wants to do, in plain words: "Run a command".
inputrequiredstring | Record<string, string | number | boolean>A command or text shows as code; an object shows as fields.
reasonstringWhy the agent wants this, shown under the input.
destructivebooleanDestructive calls need a press and hold, and are never auto-approved.
staterequiredToolCallStateoutputstring[]Output lines, streamed while running and kept once done.
iconReactNodeToolCallState
The same states the AI SDK gives a tool part, so a part can be passed straight through: approval-requested asks, approval-responded runs, and the output-* states are the result.
type ToolCallState =
| "approval-requested"
| "approval-responded"
| "output-available"
| "output-denied"
| "output-error";Dependencies
| Needs | Version | Comes from |
|---|---|---|
lucide-react | ^0.556.0 | npm, installed by the CLI |
motion | ^12.23.25 | npm, installed by the CLI |
cn from lib/utils.ts | shadcn init | |
| React | 19 | Your app |
| Tailwind CSS | 4 | Your app |
No provider, font or global CSS to set up: the file works as soon as it lands.

