Installation
Usage
Custom Colors
Use thecolor prop to apply custom colors. The component automatically adjusts text color for optimal contrast:
Sizes
Props
The button variant. Currently only supports
default.The size of the button.
sm: Small button (h-9, px-3)default: Default size (h-10, px-4)lg: Large button (h-11, px-8)icon: Square icon button (h-10, w-10)
Custom color for the button. Accepts hex colors, rgb, hsl, or CSS color names. The component automatically adjusts text color for optimal contrast.
Additional CSS classes to apply to the button.
Whether the button is disabled.
Features
- 3D Raised Appearance: Elegant shadow and gradient effects create a raised, tactile look
- Dynamic Text Contrast: Automatically calculates the optimal text color (black or white) based on background luminance
- Custom Colors: Support for hex, RGB, HSL, and CSS color names
- Accessible: Proper focus states and keyboard navigation
- Responsive: Subtle scale animation on click
- Dark Mode: Automatically adapts to dark mode themes
Accessibility
- Full keyboard navigation support
- Proper focus indicators with
focus-visible - Disabled state handling
- Semantic HTML button element
- High contrast text automatically calculated