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#

Confirm action#

API#WIP

PropTypeDefaultDescription
...propsBase UI Dialog.Root.PropsOwns modal state for destructive or irreversible confirmation flows.
PropTypeDefaultDescription
...propsBase UI Dialog.Trigger.PropsOpens the alert dialog. Compose a Button through render.
PropTypeDefaultDescription
containerHTMLElement | RefObject | nullCustom portal container for framed previews or contained overlays.
...propsBase UI Dialog.Portal.PropsPortals the alert dialog to the body or a custom container.
PropTypeDefaultDescription
overlayfalse | AlertDialogOverlayPropsPass false for framed previews; otherwise renders the themed backdrop.
...propsBase UI Dialog.Popup.PropsPortaled centered alertdialog surface. Use className for one-off width changes.
PropTypeDefaultDescription
...propsBase UI Dialog.Backdrop.PropsBackdrop behind the alert dialog while it is open.
PropTypeDefaultDescription
...propsComponentPropsWithRef<"div">Top region for the alert title and description.
PropTypeDefaultDescription
...propsComponentPropsWithRef<"div">Main content area between header and actions.
PropTypeDefaultDescription
...propsBase UI Dialog.Title.PropsAccessible alert heading.
PropTypeDefaultDescription
...propsBase UI Dialog.Description.PropsAccessible supporting copy for the alert.
PropTypeDefaultDescription
variantButton variantButton styling for the close control.
sizeButton sizeButton size for the close control.
...propsBase UI Dialog.Close.PropsCloses the alert dialog. Compose your own visual affordance with render/className.
PropTypeDefaultDescription
...propsButtonPropsThe confirming action button.
PropTypeDefaultDescription
variantButton variantoutlineButton styling for the cancelling close action.
sizeButton sizesmButton size for the cancelling close action.
...propsBase UI Dialog.Close.PropsThe cancelling close action.