Alert Dialog

A modal that interrupts for a decision. Unlike Dialog it cannot be dismissed by clicking outside — the person has to choose Cancel or the action.

tsx
import {
  AlertDialog,
  AlertDialogTrigger,
  AlertDialogContent,
  AlertDialogHeader,
  AlertDialogTitle,
  AlertDialogDescription,
  AlertDialogFooter,
  AlertDialogCancel,
  AlertDialogAction,
} from "@pestoui/core"

Destructive confirmation

AlertDialogAction and AlertDialogCancel are Buttons, so they take variant and size. Cancel receives focus when the dialog opens.

Compact, with a media tile

size="sm" narrows the panel for a one-line question. AlertDialogMedia puts an icon tile above the title.

Props

PropTypeDefaultDescription
open / defaultOpen / onOpenChangeboolean / boolean / (open: boolean) => void—On AlertDialog. Controlled or uncontrolled open state, as on the Radix root.
size"default" | "sm""default"On AlertDialogContent. The compact panel centres its header and splits the footer into two equal buttons.
variantButton["variant"]"default" / "outline"On AlertDialogAction (default) and AlertDialogCancel (outline).
AlertDialogAction sizeButton["size"]"default"On AlertDialogAction and AlertDialogCancel.
asChildboolean—On AlertDialogTrigger. Hands the trigger behaviour to the child element, normally a Button.

Pesto UI · 117 documented components