shadcn/ui Component Reference
Complete reference for all shadcn/ui components with install commands, usage code, props, and live-styled previews. Copy and paste into your Next.js project.
Search or filter by category
Copy the install command
View docs and usage examples
Accordion
LayoutA vertically stacked set of interactive headings that each reveal a section of content.
View Docs →| Prop | Type | Default |
|---|---|---|
| type | "single" | "multiple" | "single" |
| collapsible | boolean | false |
| defaultValue | string | string[] | undefined |
| disabled | boolean | false |
Aspect Ratio
LayoutDisplays content within a desired ratio. Useful for images and video embeds.
View Docs →| Prop | Type | Default |
|---|---|---|
| ratio | number | 1 |
| asChild | boolean | false |
Card
LayoutA container for grouping related content and actions with header, content, and footer sections.
View Docs →Card Title
Card Description
Card Content
Card Footer
| Prop | Type | Default |
|---|---|---|
| className | string | "" |
| children | ReactNode | undefined |
Collapsible
LayoutAn interactive component which expands and collapses a panel of content.
View Docs →| Prop | Type | Default |
|---|---|---|
| open | boolean | undefined |
| onOpenChange | (open: boolean) => void | undefined |
| defaultOpen | boolean | false |
| disabled | boolean | false |
Separator
LayoutA visual divider that separates content into distinct sections.
View Docs →Radix Primitives
An open-source UI component library.
| Prop | Type | Default |
|---|---|---|
| orientation | "horizontal" | "vertical" | "horizontal" |
| decorative | boolean | true |
| className | string | "" |
Button
FormsDisplays a button or a component that looks like a button. Supports multiple variants and sizes.
View Docs →| Prop | Type | Default |
|---|---|---|
| variant | "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | "default" |
| size | "default" | "sm" | "lg" | "icon" | "default" |
| asChild | boolean | false |
| disabled | boolean | false |
Checkbox
FormsA control that allows the user to toggle between checked and not checked states.
View Docs →| Prop | Type | Default |
|---|---|---|
| checked | boolean | "indeterminate" | undefined |
| onCheckedChange | (checked: boolean) => void | undefined |
| disabled | boolean | false |
| required | boolean | false |
Input
FormsDisplays a form input field. Supports all standard HTML input attributes.
View Docs →| Prop | Type | Default |
|---|---|---|
| type | string | "text" |
| placeholder | string | "" |
| disabled | boolean | false |
| className | string | "" |
Label
FormsRenders an accessible label associated with form controls.
View Docs →| Prop | Type | Default |
|---|---|---|
| htmlFor | string | undefined |
| className | string | "" |
Radio Group
FormsA set of checkable buttons where only one can be checked at a time.
View Docs →| Prop | Type | Default |
|---|---|---|
| defaultValue | string | undefined |
| value | string | undefined |
| onValueChange | (value: string) => void | undefined |
| disabled | boolean | false |
Select
FormsDisplays a list of options for the user to pick from, triggered by a button.
View Docs →| Prop | Type | Default |
|---|---|---|
| defaultValue | string | undefined |
| value | string | undefined |
| onValueChange | (value: string) => void | undefined |
| disabled | boolean | false |
Switch
FormsA toggle control that allows the user to switch between on and off states.
View Docs →| Prop | Type | Default |
|---|---|---|
| checked | boolean | undefined |
| onCheckedChange | (checked: boolean) => void | undefined |
| disabled | boolean | false |
| required | boolean | false |
Textarea
FormsDisplays a multi-line text input field for longer form content.
View Docs →| Prop | Type | Default |
|---|---|---|
| placeholder | string | "" |
| disabled | boolean | false |
| rows | number | undefined |
| className | string | "" |
Avatar
Data DisplayAn image element with a fallback for representing the user. Supports initials fallback.
View Docs →| Prop | Type | Default |
|---|---|---|
| src | string | undefined |
| alt | string | "" |
| className | string | "" |
Badge
Data DisplayDisplays a badge or a component that looks like a badge. Used for status indicators and labels.
View Docs →| Prop | Type | Default |
|---|---|---|
| variant | "default" | "secondary" | "outline" | "destructive" | "default" |
| className | string | "" |
Calendar
Data DisplayA date field component that allows users to enter and edit date values. Built on react-day-picker.
View Docs →| Prop | Type | Default |
|---|---|---|
| mode | "single" | "multiple" | "range" | "single" |
| selected | Date | undefined | undefined |
| onSelect | (date: Date) => void | undefined |
| disabled | Matcher | Matcher[] | undefined |
Table
Data DisplayA responsive table component for displaying rows of data with headers and footers.
View Docs →| Invoice | Status | Amount |
|---|---|---|
| INV001 | Paid | $250.00 |
| INV002 | Pending | $150.00 |
| Prop | Type | Default |
|---|---|---|
| className | string | "" |
| children | ReactNode | undefined |
Tabs
Data DisplayA set of layered sections of content displayed one at a time, triggered by tab buttons.
View Docs →Account settings here.
| Prop | Type | Default |
|---|---|---|
| defaultValue | string | undefined |
| value | string | undefined |
| onValueChange | (value: string) => void | undefined |
| orientation | "horizontal" | "vertical" | "horizontal" |
Tooltip
Data DisplayA popup that displays information related to an element when the element receives focus or hover.
View Docs →| Prop | Type | Default |
|---|---|---|
| delayDuration | number | 700 |
| skipDelayDuration | number | 300 |
| side | "top" | "right" | "bottom" | "left" | "top" |
| align | "start" | "center" | "end" | "center" |
Alert
FeedbackDisplays a callout for important information. Supports default and destructive variants.
View Docs →Heads up!
You can add components using the CLI.
| Prop | Type | Default |
|---|---|---|
| variant | "default" | "destructive" | "default" |
| className | string | "" |
Alert Dialog
FeedbackA modal dialog that interrupts the user with important content and expects a response.
View Docs →Are you absolutely sure?
This action cannot be undone.
| Prop | Type | Default |
|---|---|---|
| open | boolean | undefined |
| onOpenChange | (open: boolean) => void | undefined |
| defaultOpen | boolean | false |
Progress
FeedbackDisplays an indicator showing the completion progress of a task with an animated bar.
View Docs →| Prop | Type | Default |
|---|---|---|
| value | number | 0 |
| max | number | 100 |
| className | string | "" |
Toast
FeedbackA succinct message that is displayed temporarily. Supports actions and multiple variants.
View Docs →Scheduled: Catch up
Friday, February 10, 2024
| Prop | Type | Default |
|---|---|---|
| title | string | undefined |
| description | string | undefined |
| variant | "default" | "destructive" | "default" |
| duration | number | 5000 |
Dialog
OverlayA window overlaid on the primary content. Renders content in a portal above the page.
View Docs →Edit profile
Make changes to your profile here.
| Prop | Type | Default |
|---|---|---|
| open | boolean | undefined |
| onOpenChange | (open: boolean) => void | undefined |
| defaultOpen | boolean | false |
| modal | boolean | true |
Dropdown Menu
OverlayA menu of actions or options triggered by a button. Supports sub-menus and keyboard navigation.
View Docs →| Prop | Type | Default |
|---|---|---|
| open | boolean | undefined |
| onOpenChange | (open: boolean) => void | undefined |
| defaultOpen | boolean | false |
| modal | boolean | true |
Hover Card
OverlayFor sighted users to preview content available behind a link. Opens on hover.
View Docs →Next.js
The React Framework for the Web. Used by major companies worldwide.
| Prop | Type | Default |
|---|---|---|
| openDelay | number | 700 |
| closeDelay | number | 300 |
| open | boolean | undefined |
| onOpenChange | (open: boolean) => void | undefined |
Popover
OverlayDisplays rich content in a portal, triggered by a button. Useful for forms and pickers.
View Docs →Place content for the popover here.
| Prop | Type | Default |
|---|---|---|
| open | boolean | undefined |
| onOpenChange | (open: boolean) => void | undefined |
| defaultOpen | boolean | false |
| modal | boolean | false |
Sheet
OverlayA panel that slides in from the edge of the screen. Useful for mobile navigation and forms.
View Docs →Edit profile
Make changes here.
| Prop | Type | Default |
|---|---|---|
| side | "top" | "right" | "bottom" | "left" | "right" |
| open | boolean | undefined |
| onOpenChange | (open: boolean) => void | undefined |
| defaultOpen | boolean | false |
Breadcrumb
NavigationDisplays the path to the current resource using a hierarchy of links.
View Docs →| Prop | Type | Default |
|---|---|---|
| separator | ReactNode | "/" |
| className | string | "" |
Command
NavigationA command palette component. Searchable list of actions, similar to macOS Spotlight.
View Docs →| Prop | Type | Default |
|---|---|---|
| filter | (value: string, search: string) => number | undefined |
| shouldFilter | boolean | true |
| loop | boolean | false |
| className | string | "" |
Navigation Menu
NavigationA collection of links for navigating websites. Supports dropdown sub-menus and indicators.
View Docs →| Prop | Type | Default |
|---|---|---|
| value | string | undefined |
| onValueChange | (value: string) => void | undefined |
| delayDuration | number | 200 |
| orientation | "horizontal" | "vertical" | "horizontal" |
Pagination
NavigationNavigation for paged content. Supports previous, next, and numbered page links.
View Docs →| Prop | Type | Default |
|---|---|---|
| isActive | boolean | false |
| size | "default" | "sm" | "lg" | "icon" | "icon" |
| className | string | "" |
Get the PM Toolkit Cheat Sheet
50 tools and 880+ resources mapped across 6 categories. A 2-page PDF you'll actually use.
Instant PDF download. One email per week after that.
Want full SaaS idea playbooks with market research?
Explore Ideas Pro →