Alert Dialog
Alert Dialog is a modal that interrupts the user with important content and waits for a response before continuing.
Installation
pnpm add @viliha/vui-uiThen import from @viliha/vui-ui/alert-dialog.
Usage
AlertDialogAction and AlertDialogCancel accept VUI Button variant/size props.
alert-dialog-demo.tsx
import {
AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader,
AlertDialogTitle, AlertDialogDescription, AlertDialogFooter,
AlertDialogCancel, AlertDialogAction,
} from "@viliha/vui-ui/alert-dialog";
import { Button } from "@viliha/vui-ui/button";
export function Example() {
return (
<AlertDialog>
<AlertDialogTrigger asChild>
<Button variant="outline">Delete account</Button>
</AlertDialogTrigger>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
<AlertDialogDescription>
This action cannot be undone.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction variant="destructive">Delete</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
);
}