Appearance
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 / API | Type | Default | Notes |
|---|---|---|---|
open / onOpenChange | controlled | — | |
AlertDialogAction | button | — | Xác nhận |
AlertDialogCancel | button | — | Đóng / hủy |
Behavior
- Focus trapped
- Esc / overlay dismiss theo Radix