Shadcn UI Components
Button
Displays a button or a component that looks like a button. Built on top of Radix UI primitives with full keyboard navigation and accessibility support.
Button Variants
The button component supports multiple variants for different use cases: default, destructive, outline, secondary, ghost, and link.
Variants
Sizes
With Icons
Icon Buttons
Loading State
Disabled State
Installation
# The component is already installed at:
# src/components/ui/shadcn/button.tsx
Usage
import { Button } from '@/components/ui/shadcn/button'
export function ButtonDemo() {
return (
<Button variant="outline">Button</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 | Merge props onto child element |