Skip to content

AlertDialog ​

Dialog xác nhận chặn tương tác.

ts
import { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogAction, AlertDialogCancel } from "@minap/ui";

Examples ​

Mẫu sống trong Preview; chọn View code khi cần copy.

Usage ​

tsx
import {
  AlertDialog,
  AlertDialogAction,
  AlertDialogCancel,
  AlertDialogContent,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogHeader,
  AlertDialogTitle,
  AlertDialogTrigger,
  Button,
} from "@minap/ui";

export function Example() {
  return (
    <>
      <AlertDialog>
        <AlertDialogTrigger asChild>
          <Button color="destructive" className="w-full">
            Delete…
          </Button>
        </AlertDialogTrigger>
        <AlertDialogContent>
          <AlertDialogHeader>
            <AlertDialogTitle>Confirm</AlertDialogTitle>
            <AlertDialogDescription>Blocking confirm · touch targets ~44px</AlertDialogDescription>
          </AlertDialogHeader>
          <AlertDialogFooter>
            <AlertDialogCancel>Cancel</AlertDialogCancel>
            <AlertDialogAction>Continue</AlertDialogAction>
          </AlertDialogFooter>
        </AlertDialogContent>
      </AlertDialog>
    </>
  );
}

Props / API ​

Prop / APITypeDefaultNotes
open / onOpenChangecontrolled—
AlertDialogActionbutton—Xác nhận
AlertDialogCancelbutton—Đóng / hủy

Behavior ​

  • Focus trapped
  • Esc / overlay dismiss theo Radix

MINAP UI — Soft Periwinkle light, Mobile-First