Command Palette

Search for a command to run...

Button

A button component with different variants and sizes.

Installation

npx shadcn@latest add button

Usage

1 2 3 4 5 import { Button } from "@/components/ui/button" export function ButtonDemo() { return <Button variant="secondary" size="sm">Click me</Button> }

Props

PropTypeDefaultDescription
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.
asChildbooleanfalseWhether to render as a child component.