Skip to main content
The Alert Dialog component displays critical information that requires user acknowledgment or action.

Installation

Usage

Components

AlertDialog (Root)

boolean
Controlled open state.
boolean
Default open state.
function
Callback when state changes.

AlertDialogTrigger

Opens the alert dialog when clicked.

AlertDialogPopup

The alert dialog content container. Automatically includes backdrop and viewport.

AlertDialogHeader

Helper component for header layout with title and description.

AlertDialogFooter

Helper component for footer layout with action buttons.

AlertDialogTitle

Required for accessibility - provides the alert’s title.

AlertDialogDescription

Provides additional context about the alert.

AlertDialogClose

Closes the alert dialog when clicked.

Examples

Destructive Action

Accessibility

  • Built on @base-ui/react AlertDialog primitive
  • Focus trap keeps focus within alert
  • Cannot be dismissed by clicking backdrop
  • Escape key closes the alert
  • Requires AlertDialogTitle for accessible name
  • Returns focus to trigger on close