Edu Calvo

AI Approval

AI chats 38

About

Human-in-the-loop approval card where the chosen option expands to fill the card while the alternatives collapse away. Respects prefers-reduced-motion.

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

Code

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

Usage.tsx

"use client";

import Component from "@/components/ui/ai-approval";

export default function DemoOne() {
  return (
    <div className="flex min-h-[440px] w-full items-center justify-center bg-background p-10">
      <div className="w-full max-w-lg space-y-4">
        <Component
          options={[
            { id: "approve", label: "Run it", detail: "Applies all 3 changes" },
            { id: "dry", label: "Dry run first", detail: "Prints the plan only" },
            { id: "cancel", label: "Cancel", destructive: true },
          ]}
          question="Apply the migration to production?"
        >
          <p>
            3 tables altered, 1 column dropped. This cannot be rolled back
            automatically.
          </p>
        </Component>

        <Component
          options={[
            { id: "yes", label: "Send" },
            { id: "no", label: "Discard" },
          ]}
          question="Send the drafted reply to the customer?"
          resolvedId="yes"
        />
      </div>
    </div>
  );
}

Dependencies

More by Edu Calvo

View all
  • Scrollable Card Stack

    Scrollable Card Stack

    261
  • AI Task List

    AI Task List

    179
  • Pixel Flow Field

    Pixel Flow Field

    172
  • Siri Orb

    Siri Orb

    171
  • Cursor Follow

    Cursor Follow

    162
  • Gravity Stars

    Gravity Stars

    145
  • Agent Avatar

    Agent Avatar

    143
  • Coverflow Carousel

    Coverflow Carousel

    125

More in AI chats

View all
  • AI Actions

    AI Actions

    335
  • Message With Header And Delivery Status

    Message With Header And Delivery Status

    47
  • System Message

    System Message

    70
  • Cost Meter

    Cost Meter

    41
  • Attachments

    Attachments

    30
  • Color Picker

    Color Picker

    153
  • Message Thread

    Message Thread

    54
  • Illos Knowledge Sources

    Illos Knowledge Sources

    23