Y2K UI

Alert Dialog

A modal dialog for confirming destructive or important actions.

alert-dialog-demo.app

Installation

terminal.sh
npx y2kui@latest add alert-dialog

Usage

import {
  AlertDialog,
  AlertDialogTrigger,
  AlertDialogContent,
  AlertDialogHeader,
  AlertDialogTitle,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogAction,
  AlertDialogCancel,
} from "@/components/ui/alert-dialog";

<AlertDialog>
  <AlertDialogTrigger asChild>
    <Button variant="destructive">Delete</Button>
  </AlertDialogTrigger>
  <AlertDialogContent>...</AlertDialogContent>
</AlertDialog>;

Props

PropTypeDefaultDescription
AlertDialogsee RadixRoot. Accepts open, defaultOpen, onOpenChange.
AlertDialogContentReactNodeModal panel with navy border and pastel panel fill.
AlertDialogHeaderReactNodeGroups title and description.
AlertDialogFooterReactNodeGroups action/cancel buttons.
AlertDialogActionReactNodePrimary action button (default variant).
AlertDialogCancelReactNodeCancel button (outline variant).

On this page