soralabs

Base Alert Dialog

Component 1

About

A confirmation alert dialog for destructive or irreversible actions, built on Base UI with a 3D perspective blur entrance/exit animation, optional media icon slot, and a compact size variant.

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

Code

How Base Alert Dialog is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import {
  AlertDialog,
  AlertDialogAction,
  AlertDialogCancel,
  AlertDialogContent,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogHeader,
  AlertDialogTitle,
  AlertDialogTrigger,
} from "@/components/ui/base-alert-dialog";
import { useState } from "react";
import { Button } from "@/components/ui/base-alert-dialog-utils/button";

export default function AlertDialogSmallDemo() {
  const [open, setOpen] = useState(false);

  return (
    <div className="flex items-center justify-center p-4">
      <AlertDialog onOpenChange={setOpen} open={open}>
        <AlertDialogTrigger
          render={<Button variant="outline">Discard Changes</Button>}
        />
        <AlertDialogContent size="sm">
          <AlertDialogHeader>
            <AlertDialogTitle>Discard unsaved draft?</AlertDialogTitle>
            <AlertDialogDescription>
              All unsaved changes will be permanently discarded.
            </AlertDialogDescription>
          </AlertDialogHeader>
          <AlertDialogFooter>
            <AlertDialogCancel>Keep editing</AlertDialogCancel>
            <AlertDialogAction
              closeOnClick
              onClick={() => setOpen(false)}
              variant="destructive"
            >
              Discard
            </AlertDialogAction>
          </AlertDialogFooter>
        </AlertDialogContent>
      </AlertDialog>
    </div>
  );
}

Dependencies

More by soralabs

View all
  • Scroll Gallery

    Scroll Gallery

    202
  • Dia Text Reveal

    Dia Text Reveal

    143
  • Dock Nav

    Dock Nav

    133
  • Text Reveal Block

    Text Reveal Block

    105
  • Pixelated Image Reveal

    Pixelated Image Reveal

    94
  • Text Roll

    Text Roll

    60
  • Custom Cursor

    Custom Cursor

    47
  • Section CTA

    Section CTA

    28