AlertDialog

A modal confirmation surface for irreversible or destructive actions.

Preview#

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>

Typed delete#

API#WIP

...props
Base UI Dialog.Root.Props
Owns modal state for destructive or irreversible confirmation flows.
...props
Base UI Dialog.Trigger.Props
Opens the alert dialog. Compose a Button through render.
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.
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.
...props
Base UI Dialog.Backdrop.Props
Backdrop behind the alert dialog while it is open.
...props
ComponentPropsWithRef<"div">
Top region for the alert title and description.
...props
ComponentPropsWithRef<"div">
Main content area between header and actions.
...props
Base UI Dialog.Title.Props
Accessible alert heading.
...props
Base UI Dialog.Description.Props
Accessible supporting copy for the alert.
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.
...props
ButtonProps
The confirming action button.
variantdefault: outline
Button variant
Button styling for the cancelling close action.
sizedefault: sm
Button size
Button size for the cancelling close action.
...props
Base UI Dialog.Close.Props
The cancelling close action.