bash
npm install @hua-labs/huatsx
import { Button } from "@hua-labs/hua";variant | "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | "gradient" | "neon" | "glass" | "default" | The visual style of the button |
size | "sm" | "md" | "lg" | "xl" | "icon" | "md" | The size of the button |
hover | "springy" | "scale" | "glow" | "slide" | "none" | "springy" | Hover animation effect. 'springy' is the HUA UI signature |
rounded | "sm" | "md" | "lg" | "full" | "md" | Border radius size |
shadow | "none" | "sm" | "md" | "lg" | "xl" | "md" | Shadow depth |
loading | boolean | false | Shows loading spinner and disables button |
disabled | boolean | false | Disables the button |
icon | React.ReactNode | - | Icon element to display |
iconPosition | "left" | "right" | "left" | Position of the icon relative to text |
iconOnly | boolean | false | Renders icon only (requires aria-label) |
fullWidth | boolean | false | Makes button full width |
gradient | "blue" | "purple" | "green" | "orange" | "pink" | "custom" | "blue" | Gradient color (when variant='gradient') |
customGradient | string | - | Custom Tailwind gradient classes |
href | string | - | Renders as anchor tag when provided |
asChild | boolean | false | Merge props with child element (Slot pattern) |
Code Examples
docs:common.basicUsagetsx
import { Button } from '@hua-labs/hua';
<Button>Click me</Button>
<Button variant="destructive">Delete</Button>
<Button variant="outline">Cancel</Button>docs:common.withIconstsx
<Button icon={<DownloadSimple />}>Download</Button>
<Button icon={<PaperPlaneTilt />} iconPosition="right">Send</Button>docs:common.statestsx
<Button loading>Saving...</Button>docs:common.gradienttsx
<Button variant="gradient" gradient="purple">Get Started</Button>- •Keyboard: Fully navigable with Tab and activatable with Enter/Space
- •aria-disabled: Applied when disabled or loading
- •aria-busy: Applied during loading state
- •Reduced Motion: Respects prefers-reduced-motion setting
- •Icon Only: Requires aria-label when using iconOnly