AlertDialog
A modal confirmation surface for irreversible or destructive actions.
Use AlertDialog for destructive confirmation, irreversible changes, and typed-delete flows. Use Dialog for editable forms and non-destructive modal content.
import {
AlertDialog,
AlertDialogAction,
AlertDialogBody,
AlertDialogCancel,
AlertDialogClose,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "raft-ui";
<AlertDialog>
<AlertDialogTrigger />
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle />
<AlertDialogClose />
</AlertDialogHeader>
<AlertDialogBody>
<AlertDialogDescription />
</AlertDialogBody>
<AlertDialogFooter>
<AlertDialogCancel />
<AlertDialogAction />
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>...propsBase UI Dialog.Root.Props
Owns modal state for destructive or irreversible confirmation flows.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | Base UI Dialog.Root.Props | — | Owns modal state for destructive or irreversible confirmation flows. |
...propsBase UI Dialog.Trigger.Props
Opens the alert dialog. Compose a Button through render.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | Base UI Dialog.Trigger.Props | — | Opens the alert dialog. Compose a Button through render. |
containerHTMLElement | RefObject | null
Custom portal container for framed previews or contained overlays.
...propsBase UI Dialog.Portal.Props
Portals the alert dialog to the body or a custom container.
| Prop | Type | Default | Description |
|---|---|---|---|
container | HTMLElement | RefObject | null | — | Custom portal container for framed previews or contained overlays. |
...props | Base UI Dialog.Portal.Props | — | Portals the alert dialog to the body or a custom container. |
overlayfalse | AlertDialogOverlayProps
Pass false for framed previews; otherwise renders the themed backdrop.
...propsBase UI Dialog.Popup.Props
Portaled centered alertdialog surface. Use className for one-off width changes.
| Prop | Type | Default | Description |
|---|---|---|---|
overlay | false | AlertDialogOverlayProps | — | Pass false for framed previews; otherwise renders the themed backdrop. |
...props | Base UI Dialog.Popup.Props | — | Portaled centered alertdialog surface. Use className for one-off width changes. |
...propsBase UI Dialog.Backdrop.Props
Backdrop behind the alert dialog while it is open.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | Base UI Dialog.Backdrop.Props | — | Backdrop behind the alert dialog while it is open. |
...propsComponentPropsWithRef<"div">
Top region for the alert title and description.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | ComponentPropsWithRef<"div"> | — | Top region for the alert title and description. |
...propsComponentPropsWithRef<"div">
Main content area between header and actions.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | ComponentPropsWithRef<"div"> | — | Main content area between header and actions. |
...propsBase UI Dialog.Title.Props
Accessible alert heading.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | Base UI Dialog.Title.Props | — | Accessible alert heading. |
...propsBase UI Dialog.Description.Props
Accessible supporting copy for the alert.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | Base UI Dialog.Description.Props | — | Accessible supporting copy for the alert. |
variantButton variant
Button styling for the close control.
sizeButton size
Button size for the close control.
...propsBase UI Dialog.Close.Props
Closes the alert dialog. Compose your own visual affordance with render/className.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | Button variant | — | Button styling for the close control. |
size | Button size | — | Button size for the close control. |
...props | Base UI Dialog.Close.Props | — | Closes the alert dialog. Compose your own visual affordance with render/className. |
...propsButtonProps
The confirming action button.
| Prop | Type | Default | Description |
|---|---|---|---|
...props | ButtonProps | — | The confirming action button. |
variantdefault: outlineButton variant
Button styling for the cancelling close action.
sizedefault: smButton size
Button size for the cancelling close action.
...propsBase UI Dialog.Close.Props
The cancelling close action.
| Prop | Type | Default | Description |
|---|---|---|---|
variant | Button variant | outline | Button styling for the cancelling close action. |
size | Button size | sm | Button size for the cancelling close action. |
...props | Base UI Dialog.Close.Props | — | The cancelling close action. |