Button
A versatile, production-ready button system with 8 visual variants, 4 sizes, loading spinner states, icon slots, and spring tap feedback.
Visual Variants
Sizes & Interactive Loading
Installation
Add the component directly to your repository using shadcn CLI:
npx shadcn@latest add Surajmaurya1/easyui/button
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive' | 'success' | 'link' | 'gradient' | 'primary' | Visual presentation style |
| size | 'sm' | 'md' | 'lg' | 'icon' | 'md' | Dimensions and typography scale |
| isLoading | boolean | false | Displays an animated spinner and disables user interaction |
| loadingText | string | undefined | Optional text displayed alongside the loading spinner |
| leftIcon | React.ReactNode | undefined | Icon element placed before children |
| rightIcon | React.ReactNode | undefined | Icon element placed after children |
| fullWidth | boolean | false | Stretches button to 100% width of parent container |
| disabled | boolean | false | Prevents interaction and applies 30% disabled opacity |