Components
ConfirmDialog
Confirmation dialog component built on top of AlertDialog.
Overview
ConfirmDialog is a reusable confirmation modal built using AlertDialog.
It supports:
- Confirmation actions
- Destructive actions
- Form submission
- Loading states
- Custom content
Useful for:
- Delete confirmation
- Submit confirmation
- Approve / reject actions
- Form confirmation flows
Examples
Basic Usage
Usage
Action Confirmation
With Form Submission
Loading State
API
ConfirmDialog
Prop
Type
Form vs Action Mode
ConfirmDialog supports two mutually exclusive modes:
| Mode | Required Prop |
|---|---|
| Action callback | handleConfirm |
| Form submission | form |
Notes
- When
formis provided, the confirm button automatically becomestype="submit". - When
handleConfirmis used, the confirm button acts as a normal button. destructivechanges the confirm button variant to destructive styling.isLoadingdisables both cancel and confirm actions.
How is this guide?