- Accordion
- Action Bar
- Action Toast
- Alert Banner
- Alert Dialog
- Alert
- Alphabet Index
- Amount Field
- Aspect Ratio
- Attachment
- Availability List
- Avatar
- Badge
- Bank Card
- Breadcrumb
- Bubble
- Button Group
- Button
- Calendar
- Camera Frame
- Card Design Picker
- Card Details
- Card Peek
- Card Stack
- Card
- Carousel
- Chart
- Chat Thread
- Checkbox
- Chip Group
- Choice Tile
- Code Block
- Code Dots
- Collapsible
- Combobox
- Command
- Context Menu
- Copy Field
- Countdown
- Country Select
- Data Table
- Date Field
- Date Picker
- Date Range Picker
- Dialog
- Direction
- Document Paper
- Drawer
- Dropdown Menu
- Empty
- Entity Avatar
- Field
- File Trigger
- File Upload Item
- Hover Card
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Key Value
- Keypad
- Label
- Live Region
- Marker
- Message Scroller
- Message
- Money Amount
- Native Select
- Number Field
- Pagination
- Percent Split Editor
- Phone Field
- Popover
- Progress
- QR Code
- Questionnaire
- Radio Group
- Range Histogram
- Rating
- Resizable
- Scroll Area
- Search Field
- Select
- Separator
- Share Bar
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Sortable List
- Spinner
- Status Timeline
- Step Header
- Steps List
- Swipe Row
- Switch
- Table
- Tabs
- Text Field
- Textarea
- Tier Ladder
- Toggle Group
- Toggle
- Token Search Field
- Tooltip
- Trace
- Transaction Row
- Usage Meter
import {
AlertDialog,
AlertDialogAction,
Installation#
pnpm dlx shadcn@latest add @dots/alert-dialog
Usage#
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog"<AlertDialogTrigger>
<Button variant="outline">Show Dialog</Button>
<AlertDialog>
<AlertDialogHeader>
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
<AlertDialogDescription>
This action cannot be undone. This will permanently delete your account
from our servers.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction>Continue</AlertDialogAction>
</AlertDialogFooter>
</AlertDialog>
</AlertDialogTrigger>Composition#
Use the following composition to build an AlertDialog:
AlertDialogTrigger
├── Button
└── AlertDialog
├── AlertDialogHeader
│ ├── AlertDialogMedia
│ ├── AlertDialogTitle
│ └── AlertDialogDescription
└── AlertDialogFooter
├── AlertDialogCancel
└── AlertDialogActionBasic#
A basic alert dialog with a title, description, and cancel and continue buttons.
import {
AlertDialog,
AlertDialogAction,
Small#
Use the size="sm" prop to make the alert dialog smaller.
import {
AlertDialog,
AlertDialogAction,
Media#
Use the AlertDialogMedia component to add a media element such as an icon or image to the alert dialog.
import { CircleFadingPlusIcon } from "lucide-react"
import {
Small with Media#
Use the size="sm" prop to make the alert dialog smaller and the AlertDialogMedia component to add a media element such as an icon or image to the alert dialog.
import { BluetoothIcon } from "lucide-react"
import {
Destructive#
Use the AlertDialogAction component to add a destructive action button to the alert dialog.
import { Trash2Icon } from "lucide-react"
import {
API Reference#
size#
Use the size props on the AlertDialogContent component to control the size of the alert dialog. It accepts the following values:
| Prop | Type | Default |
|---|---|---|
size | "default" | "sm" | "default" |
For more information about the other components and their props, see the React Aria documentation.