Alert Dialog
A modal dialog that interrupts the user with important content and expects a response.
Component Features
- 🛑 Interruptive: Forces the user to make a decision before continuing.
- ⌨️ Keyboard Support: Full keyboard navigation, including
Escapeto close (if allowed) andTabtrapping. - 🎨 Customizable: Easy to customize styles and colors for different intent (e.g., danger/destructive actions).
- ♿ Accessible: Follows WAI-ARIA guidelines for dialogs.
Basic Usage
The most basic alert dialog display.
Custom Action Color
You can customize the color of the action button to match the intent of the dialog, such as using color="danger" for destructive actions.
Async Loading & Prevent Outside Close
For async submits (delete/payment/unlink, etc.), it's common to:
- Show a loading state and prevent duplicate clicks
- Block outside click and
ESCclosing while the request is in-flight
API Reference
BrAlertDialog
BrAlertDialogTrigger
Used to wrap the element that will trigger the alert dialog.
BrAlertDialogContent
BrAlertDialogHeader / BrAlertDialogFooter
Containers for the header (title/description) and footer (action/cancel buttons).