Skip to content

ConfirmDialog

Confirmation dialog built on Radix AlertDialog.

Props

ConfirmDialogProps

PropTypeRequiredDescription
openbooleanYesWhether dialog is open
optionsConfirmOptions | nullYesDialog configuration
onConfirm() => voidYesCalled when user confirms
onCancel() => voidYesCalled when user cancels

ConfirmOptions

PropertyTypeDefaultDescription
titlestringRequiredDialog title
descriptionstring-Dialog description
confirmLabelstring'Confirm'Confirm button text
cancelLabelstring'Cancel'Cancel button text
variant'default' | 'destructive''default'Button styling

Example

tsx
const { state, confirm, handleConfirm, handleCancel } = useConfirmation()

<ConfirmDialog
  open={state.isOpen}
  options={state.options}
  onConfirm={handleConfirm}
  onCancel={handleCancel}
/>

See also