# shadcn/ui Component Reference
Complete catalog of shadcn/ui components with usage patterns and installation.
## Installation
**Add specific components:**
```bash
npx shadcn@latest add button
npx shadcn@latest add button card dialog # Multiple
npx shadcn@latest add --all # All components
```
Components install to `components/ui/` with automatic dependency management.
## Form & Input Components
### Button
```tsx
import { Button } from "@/components/ui/button"
```
Variants: `default | destructive | outline | secondary | ghost | link`
Sizes: `default | sm | lg | icon`
### Input
```tsx
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
```
### Form (with React Hook Form + Zod)
```tsx
import { useForm } from "react-hook-form"
import { zodResolver } from "@hookform/resolvers/zod"
import * as z from "zod"
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form"
import { Input } from "@/components/ui/input"
import { Button } from "@/components/ui/button"
const schema = z.object({
username: z.string().min(2).max(50),
email: z.string().email()
})
function ProfileForm() {
const form = useForm({
resolver: zodResolver(schema),
defaultValues: { username: "", email: "" }
})
return (
)
}
```
### Select
```tsx
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"
```
### Checkbox
```tsx
import { Checkbox } from "@/components/ui/checkbox"
import { Label } from "@/components/ui/label"
```
### Radio Group
```tsx
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"
import { Label } from "@/components/ui/label"
```
### Textarea
```tsx
import { Textarea } from "@/components/ui/textarea"
```
### Switch
```tsx
import { Switch } from "@/components/ui/switch"
import { Label } from "@/components/ui/label"
```
### Date Picker
```tsx
import { Calendar } from "@/components/ui/calendar"
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"
import { Button } from "@/components/ui/button"
import { CalendarIcon } from "lucide-react"
import { format } from "date-fns"
import { useState } from "react"
const [date, setDate] = useState()
```
## Layout & Navigation
### Card
```tsx
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"
Card Title
Card Description
Card Content
```
### Tabs
```tsx
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
Account
Password
Account settings
Password settings
```
### Accordion
```tsx
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion"
Is it accessible?
Yes. It adheres to WAI-ARIA design pattern.
Is it styled?
Yes. Comes with default styles customizable with Tailwind.
```
### Navigation Menu
```tsx
import { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger } from "@/components/ui/navigation-menu"
Getting Started
Introduction
Installation
```
## Overlays & Dialogs
### Dialog
```tsx
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog"
```
### Drawer
```tsx
import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger } from "@/components/ui/drawer"
Open
Title
Description
Cancel
```
### Popover
```tsx
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"
Open
Content here
```
### Toast
```tsx
import { useToast } from "@/hooks/use-toast"
import { Button } from "@/components/ui/button"
const { toast } = useToast()
```
### Command
```tsx
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@/components/ui/command"
No results found.
Calendar
Search Emoji
Calculator
```
### Alert Dialog
```tsx
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "@/components/ui/alert-dialog"
Absolutely sure?
This permanently deletes your account and removes data from servers.
Cancel
Continue
```
## Feedback & Status
### Alert
```tsx
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"
Heads up!
You can add components using CLI.
Error
Session expired. Please log in.
```
### Progress
```tsx
import { Progress } from "@/components/ui/progress"
```
### Skeleton
```tsx
import { Skeleton } from "@/components/ui/skeleton"
```
## Display Components
### Table
```tsx
import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"
Recent invoices
Invoice
Status
Amount
INV001
Paid
$250.00
```
### Avatar
```tsx
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
CN
```
### Badge
```tsx
import { Badge } from "@/components/ui/badge"
Default
Secondary
Destructive
Outline
```