Alert Dialog

A modal dialog that interrupts the user with important content, requiring action.

Installation

Import the component from the passport-ui package.

components/example.tsx
1import {
2 AlertDialog,
3 AlertDialogAction,
4 AlertDialogCancel,
5 AlertDialogContent,
6 AlertDialogDescription,
7 AlertDialogFooter,
8 AlertDialogHeader,
9 AlertDialogTitle,
10 AlertDialogTrigger,
11} from "passport-ui";

Usage

Basic example showing how to use the component.

components/example.tsx
1<AlertDialog>
2 <AlertDialogTrigger asChild>
3 <Button variant="outline">Show Dialog</Button>
4 </AlertDialogTrigger>
5 <AlertDialogContent>
6 <div className="meta-container">
7 <h3>Are you absolutely sure?</h3>
8 <p>
9 This action cannot be undone. This will permanently delete your
10 account and remove your data from our servers.
11 </p>
12 </div>
13 <AlertDialogFooter>
14 <AlertDialogCancel variant="ghost">Cancel</AlertDialogCancel>
15 <AlertDialogAction>Continue</AlertDialogAction>
16 </AlertDialogFooter>
17 </AlertDialogContent>
18</AlertDialog>

Additional resources

Documentation and examples are available in Storybook.