Skip to main content

ConfirmDialog

A role="alertdialog" "are you sure?" — the replacement for window.confirm.

Signature
Density
Viewport
Theme and light/dark are set in the top bar
Live demo
Open ↗

When 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​

PropTypeRequiredDescription
isOpenbooleanYes
onConfirm() => void—Confirm button.
onCancel() => void—Cancel button and Escape (a click outside does nothing).
isPendingboolean—While your action runs: both buttons disabled, confirm aria-busy, Escape ignored.
pendingLabelReact.ReactNode—Confirm button text while pending, e.g. "Voiding…".