Appearance
ConfirmDialog
Confirmation dialog built on Radix AlertDialog.
Props
ConfirmDialogProps
| Prop | Type | Required | Description |
|---|---|---|---|
open | boolean | Yes | Whether dialog is open |
options | ConfirmOptions | null | Yes | Dialog configuration |
onConfirm | () => void | Yes | Called when user confirms |
onCancel | () => void | Yes | Called when user cancels |
ConfirmOptions
| Property | Type | Default | Description |
|---|---|---|---|
title | string | Required | Dialog title |
description | string | - | Dialog description |
confirmLabel | string | 'Confirm' | Confirm button text |
cancelLabel | string | '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}
/>