Components
- Accordion
- Action Bar
- Alert Dialog
- Alert
- Announcement
- Aspect Ratio
- Autocomplete
- Avatar
- Badge
- Bottom Navigation
- Breadcrumb
- Button Group
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Circular Progress
- Circular Slider
- Clipboard
- Collapsible
- Color Picker
- Combobox
- Command
- Context Menu
- Data List
- Date Picker
- Dialog
- Drawer
- Editable
- Field
- File Upload
- Float
- Floating Panel
- Frame
- Hint
- Hover Card
- Image Cropper
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Link Overlay
- Listbox
- Marquee
- Menu
- Native Select
- Number Input
- Pagination
- Popover
- Progress
- Prose
- QR Code
- Radio Group
- Rating
- Resizable
- Scroll Area
- Segment Group
- Select
- Separator
- Sheet
- Sidebar
- Signature Pad
- Skeleton
- Skip Nav
- Slider
- Spinner
- Status
- Steps
- Switch
- Table
- Tabs
- Textarea
- Timer
- Toast
- Toggle Group
- Toggle Tooltip
- Toggle
- Tooltip
- Tour
- Tree View
Built on top of the <Dialog /> component. Check it out for more examples.
Installation
pnpm dlx shadcn@latest add https://shark.vini.one/r/alert-dialog.json
Usage
import { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogBody, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, AlertDialogHeader, AlertDialogFooter, } from "@/components/ui/alert-dialog";
<AlertDialog> <AlertDialogTrigger /> <AlertDialogContent> <AlertDialogHeader> <AlertDialogTitle /> <AlertDialogDescription /> </AlertDialogHeader> <AlertDialogBody> {/** Your content here */} </AlertDialogBody> <AlertDialogFooter> <AlertDialogCancel /> <AlertDialogAction /> </AlertDialogFooter> </AlertDialogContent> </AlertDialog>
Examples
Destructive
API Reference
AlertDialogAction
Primary action (e.g. confirm, delete). Closes the dialog on click.
| Prop | Type | Default |
|---|---|---|
variant | "default" | "destructive" | "default" |
className | string | - |
asChild | boolean | false |
AlertDialogCancel
Cancel action. Closes the dialog without committing.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |
For a complete list of props, see the Dialog API Reference.