Installation
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "red" | "green" | "blue" | "orange" | "grey" | "red" | Color variant for the button |
holdDuration | number | 3000 | Duration in milliseconds to hold before action completes |
className | string | - | Additional CSS classes |
Variants
Each variant comes with a matching icon:- red - Trash icon (for delete actions)
- green - Archive icon
- blue - XCircle icon
- orange - AlertCircle icon
- grey - Ban icon
Dependencies
motion/react(Framer Motion) - For progress bar animationlucide-react- For variant iconsclass-variance-authority- For variant styling@/components/ui/button- Base button component@/lib/utils- Utility functions (cn)
Features
- Visual progress indicator while holding
- Touch-friendly (supports both mouse and touch events)
- Five color variants for different action types
- Automatically resets if user releases early
- Dark mode support
- Perfect for confirming destructive actions