Components/ConfirmDialog

ConfirmDialog

Confirmation modal with async confirm, loading state, and danger variant.

Installation

Examples

Danger confirmation

Destructive action with red confirm button.

Delete account?

This will permanently delete your account and all data. This cannot be undone.

Default confirmation

Standard confirm with neutral styling.

Publish changes?

Your changes will be visible to all users immediately.

API Reference

PropTypeDefaultDescription
openbooleanControlled open state.
onOpenChange(v: boolean) => voidCalled when state changes.
titleReactNode'Are you sure?'Dialog heading.
descriptionReactNodeExplanation of the action.
confirmLabelstring'Confirm'Confirm button label.
cancelLabelstring'Cancel'Cancel button label.
variant'default'|'danger''default'danger applies destructive styling.
onConfirm() => void | Promise<void>Called when confirmed. Awaited if async.
loadingbooleanfalseShows spinner on confirm button.