Component
A dialog that is used to display a message to the user. It is used to confirm or cancel an action.
View component changelogImport all parts of the component and piece them together
The root component for the AlertDialog.
| Prop | Type | Default |
|---|---|---|
className | string | -- |
customRootClass | string | -- |
open | boolean | -- |
defaultOpen | boolean | false |
onOpenChange | function | -- |
dismissOnOutsidePress | boolean | false |
The trigger component for the AlertDialog.
| Prop | Type | Default |
|---|---|---|
className | string | -- |
asChild | boolean | false |
The portal component for the AlertDialog.
| Prop | Type | Default |
|---|---|---|
children | ReactNode | -- |
container | Element | null | -- |
forceMount | boolean | false |
keepMounted | boolean | false |
The overlay component for the AlertDialog.
| Prop | Type | Default |
|---|---|---|
className | string | '' |
asChild | boolean | false |
forceMount | boolean | false |
The content component for the AlertDialog.
| Prop | Type | Default |
|---|---|---|
className | string | '' |
children | ReactNode | -- |
asChild | boolean | false |
forceMount | boolean | false |
The title component for the AlertDialog.
| Prop | Type | Default |
|---|---|---|
className | string | '' |
children | ReactNode | -- |
asChild | boolean | false |
id | string | auto |
The description component for the AlertDialog.
| Prop | Type | Default |
|---|---|---|
className | string | '' |
children | ReactNode | -- |
asChild | boolean | false |
id | string | auto |
A layout container for alert dialog actions.
| Prop | Type | Default |
|---|---|---|
className | string | '' |
The action component for the AlertDialog.
| Prop | Type | Default |
|---|---|---|
className | ||
children | ReactNode | -- |
asChild | boolean | false |
The cancel component for the AlertDialog.
| Prop | Type | Default |
|---|---|---|
className | ||
children | ReactNode | -- |
asChild | boolean | false |
| Shortcut | Description |
|---|---|
Escape | Closes the alert dialog when cancel or dismiss behavior is available. |
Tab | Moves focus to the next focusable control inside the alert dialog. |
Shift + Tab | Moves focus to the previous focusable control inside the alert dialog. |
| Reference | What Rad UI follows |
|---|---|
Uses alert dialog semantics for confirmation flows that interrupt the current task and require a response. | |
Inherits modal dialog focus containment, labelling, description, and focus restoration expectations. |