Button
Highly interactive button component with support for multiple variants, sizes, and states.
Installation
bash
npx canx-ui add buttonUsage
tsx
import { Button } from "@/components/ui/button";
export default function Demo() {
return (
<div className="flex flex-wrap gap-4">
<Button variant="default">Default</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="destructive">Destructive</Button>
<Button variant="outline">Outline</Button>
<Button variant="ghost">Ghost</Button>
<Button variant="link">Link</Button>
</div>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "primary" | "secondary" | "destructive" | "outline" | "ghost" | "link" | "default" | Visual style of the button. |
| size | "default" | "sm" | "lg" | "icon" | "default" | Size of the button. |
| asChild | boolean | false | Merge props onto the immediate child. |