---
url: https://react-ui.bas.dev/settings/confirm-dialog.md
---
# ConfirmDialog

One destructive step, asked before it happens, over whichever dialog it was opened from. It is a [`PromptDialog`](/overlays/prompt-dialog) with the danger button, stacked as a nested dialog, that closes itself once the step succeeds.

```tsx
import { ConfirmDialog } from '@basmilius/react-ui/settings';
```

`onConfirm` returns a promise. While it runs the button goes quiet; when it resolves the dialog closes; when it rejects the reason stays on screen and the dialog stays open.

| Prop | Type | |
| --- | --- | --- |
| `open` | `boolean` | Required. |
| `onOpenChange` | `(open: boolean) => void` | Required. |
| `title` | `string` | Required. |
| `description` | `string` | Required. |
| `confirmLabel` | `string` | Required. |
| `onConfirm` | `() => Promise<void>` | Required. |

`ConfirmDialogProps` is an exported type.
