Button
A button component with different variants and sizes.
Installation
npx shadcn@latest add buttonUsage
1
2
3
4
5
import { Button } from "@/components/ui/button"
export function ButtonDemo() {
return <Button variant="secondary" size="sm">Click me</Button>
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link' | 'default' | The visual style of the button. |
| size | 'default' | 'sm' | 'lg' | 'icon' | 'default' | The size of the button. |
| asChild | boolean | false | Whether to render as a child component. |