Alert Dialog
A modal dialog for critical confirmations that requires user action. Built on Base UI AlertDialog primitive with accessibility features like focus trapping and Escape key handling disabled by default.Compound Components
AlertDialog.Root
The root container that manages alert dialog state.Controlled open state. When provided, the dialog becomes controlled.
Uncontrolled default open state.
Callback fired when the open state changes.
Whether the dialog is modal (blocks interaction with the rest of the page).
AlertDialog.Trigger
The trigger element that opens the alert dialog.Additional CSS classes to apply.
Merge props onto the child element instead of rendering a button.
AlertDialog.Portal
Portals the alert dialog content to the end of the document body.Whether to keep the dialog mounted in the DOM when closed. When
false, uses AnimatePresence for mount/unmount animations.The container element to portal into. Defaults to
document.body.AlertDialog.Backdrop
The backdrop overlay behind the alert dialog.Additional CSS classes to apply. Default:
"fixed inset-0 z-50 bg-utility-backdrop"AlertDialog.Popup
The alert dialog popup container with positioning and animation.Additional CSS classes to apply.
- Mobile (< 640px): Bottom sheet with 8px padding
- Desktop: Centered modal, max-width 400px
- Mobile: Slides up from bottom
- Desktop: Scale from 0.95 to 1 with fade
- Respects reduced motion preferences
AlertDialog.Content
Inner content area with optional icon, title, and description.Optional icon to display above the title.
Color tone for the icon:
default: Content strong colordanger: Danger feedback colorwarning: Warning feedback colorinfo: Info feedback colorsuccess: Success feedback color
Additional CSS classes to apply.
AlertDialog.Title
Accessible alert dialog title.Additional CSS classes to apply. Default: Large semibold text with strong content color.
AlertDialog.Description
Accessible alert dialog description.Additional CSS classes to apply. Default: Medium text with subtle content color.
AlertDialog.Close
Close button wrapper. Must wrap a Button component.Additional CSS classes to apply. Default:
"outline-none flex-1"Merge props onto the child element.
AlertDialog.Footer
Footer section for action buttons.Additional CSS classes to apply.
- All buttons fill available width equally
- 12px gap between buttons
- Padding: 16px vertical, 24px horizontal
Usage
Icon Tones
Types
Accessibility
- Focus is trapped within the dialog when open
- Escape key is disabled by default (use explicit Close buttons)
- Backdrop click is disabled by default
- Title and description are linked via
aria-labelledbyandaria-describedby - First focusable element receives focus on open