ConfirmDialog
A role="alertdialog" "are you sure?" — the replacement for window.confirm.
Signature
Density
Viewport
Theme and light/dark are set in the top barWhen to use
A role="alertdialog" "are you sure?" — the replacement for window.confirm.
Accessibility
Focus is trapped while open and restored to the trigger on close. Esc dismisses. The surface is labelled by its title (aria-labelledby) and marked role="dialog" / aria-modal.
Install and import
npx shadcn@latest add @prism/confirm-dialog
import { ConfirmDialog } from '@/components/prism/ConfirmDialog';
In a no-build prototype, read it from the bundle instead: const { ConfirmDialog } = window.PrismDesignSystem_39d121;
Props
| Prop | Type | Required | Description |
|---|---|---|---|
isOpen | boolean | Yes | |
onConfirm | () => void | — | Confirm button. |
onCancel | () => void | — | Cancel button and Escape (a click outside does nothing). |
isPending | boolean | — | While your action runs: both buttons disabled, confirm aria-busy, Escape ignored. |
pendingLabel | React.ReactNode | — | Confirm button text while pending, e.g. "Voiding…". |