Saurabh

Tool Approval

Component 16

About

A human-in-the-loop permission card that shows an AI agent's requested tool call and lets a user allow once, always allow, or deny before it runs.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Tool Approval to your project and fits it to your theme.

Code

How Tool Approval is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import ToolApproval from "@/components/ui/tool-approval";

export default function ToolApprovalDemo() {
  return (
    <div className="flex w-full max-w-lg items-center justify-center p-8">
      <ToolApproval
        tool='fs.write(path: "src/app/page.tsx")'
        description="This will overwrite the existing file with new content."
        parameters={[
          { id: "path", label: "path", value: "src/app/page.tsx" },
          { id: "bytes", label: "bytes", value: "1,204" },
        ]}
        status="pending"
        defaultOpen
        onApprove={() => {}}
        onAlwaysAllow={() => {}}
        onDeny={() => {}}
      />
    </div>
  );
}

Dependencies

More by Saurabh

View all
  • BeUI Tilt Card

    BeUI Tilt Card

    369
  • BeUI Expandable Tabs

    BeUI Expandable Tabs

    346
  • BeUI File Upload

    BeUI File Upload

    293
  • BeUI Bouncy Accordion

    BeUI Bouncy Accordion

    200
  • BeUI Create Menu

    BeUI Create Menu

    199
  • BeUI Expanable Action Bar

    BeUI Expanable Action Bar

    184
  • Loader

    Loader

    173
  • BeUI 404 / Not Found

    BeUI 404 / Not Found

    166