Installation
Dependencies
This component requires the following dependencies:button- shadcn/ui button componentdialog- shadcn/ui dialog componentlucide-react- Icon library (AlertTriangleIcon)
Usage
Features
- Warning visual - Red alert triangle icon in circular background
- Destructive trigger - Uses
variant="destructive"for the trigger button - Horizontal layout - Icon and text arranged side-by-side
- Clear consequences - Description explains what will happen
- Dual actions - Cancel and confirm buttons in footer
- Accessible - Proper semantic structure and ARIA attributes
Component Structure
The component includes:Dialogwrapper with controlled stateDialogTriggerwith destructive stylingDialogContentwith horizontal layout using flexbox- Warning icon (AlertTriangleIcon) in red circular background
DialogHeaderwith title and warning descriptionDialogFooterwith Cancel and Deactivate buttons- State management for open/close behavior
This pattern is ideal for destructive actions like account deactivation, data deletion, or other irreversible operations. Always clearly communicate the consequences to users.