Skip to content

Shadcn UI Cheatsheet

Every shadcn/ui component on one page: what it is for, the exact CLI command that installs it, and a link to full examples for both Base UI and Radix. Install commands are the real ones from each component's own page, not a guess at the naming.

New to the CLI? Start with installation and components.json. Unsure which primitive to install against, Base UI or Radix? See Base UI vs Radix.

The whole set in one command

bash
npx shadcn@latest add accordion alert alert-dialog aspect-ratio avatar badge \
  breadcrumb button button-group calendar card carousel chart checkbox \
  collapsible command context-menu dialog drawer dropdown-menu empty field \
  form hover-card input input-group input-otp item kbd label marker menubar \
  message message-scroller native-select navigation-menu pagination popover \
  progress radio-group resizable scroll-area select separator sheet sidebar \
  skeleton slider sonner spinner switch table tabs textarea toggle \
  toggle-group tooltip

Three entries below are patterns rather than single components — Combobox, Date Picker and Data Table each compose two or three of the above. Typography ships as utility-class recipes with nothing to install.

Buttons and actions

ComponentInstallUse it for
Buttonnpx shadcn@latest add buttonActions and links — six variants, four sizes, icons, loading, as-link
Button Groupnpx shadcn@latest add button-groupJoining related buttons into one connected control
Togglenpx shadcn@latest add toggleA two-state button with a pressed / unpressed state
Toggle Groupnpx shadcn@latest add toggle-groupA set of related two-state buttons
Kbdnpx shadcn@latest add kbdRendering keyboard keys and shortcuts consistently

Forms and inputs

ComponentInstallUse it for
Formnpx shadcn@latest add formWiring React Hook Form + Zod to accessible fields
Fieldnpx shadcn@latest add fieldLabel, description and error in one consistent structure
Inputnpx shadcn@latest add inputSingle-line text entry
Input Groupnpx shadcn@latest add input-groupAttaching a leading icon, prefix or trailing button to an input
Input OTPnpx shadcn@latest add input-otpOne-time-password entry, one slot per digit
Textareanpx shadcn@latest add textareaMulti-line text entry
Labelnpx shadcn@latest add labelNaming a form control
Selectnpx shadcn@latest add selectPicking one option from a styled list
Native Selectnpx shadcn@latest add native-selectA styled wrapper around the browser's own <select>
Comboboxnpx shadcn@latest add popover command buttonSearchable single-select — composes Popover + Command + Button
Checkboxnpx shadcn@latest add checkboxBoolean choices
Radio Groupnpx shadcn@latest add radio-groupExactly one choice from a visible set
Switchnpx shadcn@latest add switchA single on/off setting
Slidernpx shadcn@latest add sliderPicking a value in a range by dragging
Calendarnpx shadcn@latest add calendarAn inline date picker, built on react-day-picker
Date Pickernpx shadcn@latest add calendar popover buttonA compact date control — composes Calendar + Popover + Button

Overlays and menus

ComponentInstallUse it for
Dialognpx shadcn@latest add dialogModal overlay for focused tasks: confirmations, forms, detail views
Alert Dialognpx shadcn@latest add alert-dialogConfirmations that need an explicit choice
Sheetnpx shadcn@latest add sheetA panel sliding in from a screen edge
Drawernpx shadcn@latest add drawerA draggable panel sliding up from the bottom, built on Vaul
Popovernpx shadcn@latest add popoverRich floating content anchored to a trigger, on click
Hover Cardnpx shadcn@latest add hover-cardA rich preview on hovering a link or name
Tooltipnpx shadcn@latest add tooltipA short label on hover or focus
Dropdown Menunpx shadcn@latest add dropdown-menuA list of actions triggered by a button
Context Menunpx shadcn@latest add context-menuActions on right-click or long-press
Menubarnpx shadcn@latest add menubarA desktop-style application menu bar
Commandnpx shadcn@latest add commandA fast searchable command palette, built on cmdk
ComponentInstallUse it for
Navigation Menunpx shadcn@latest add navigation-menuPrimary site nav whose items open panels of links
Sidebarnpx shadcn@latest add sidebarA composable, collapsible app navigation panel
Breadcrumbnpx shadcn@latest add breadcrumbShowing where a page sits in the hierarchy
Paginationnpx shadcn@latest add paginationMoving between pages of results
Tabsnpx shadcn@latest add tabsSwitching between related panels in the same space
Accordionnpx shadcn@latest add accordionMultiple collapsible sections
Collapsiblenpx shadcn@latest add collapsibleToggling one region open and closed
Resizablenpx shadcn@latest add resizablePanel layouts the user resizes by dragging
Scroll Areanpx shadcn@latest add scroll-areaA consistent styled scrollbar across browsers
Carouselnpx shadcn@latest add carouselA swipeable slider, built on Embla
Separatornpx shadcn@latest add separatorA dividing line between content or controls
Aspect Rationpx shadcn@latest add aspect-ratioLocking content to a fixed width-to-height ratio

Data display

ComponentInstallUse it for
Tablenpx shadcn@latest add tableStyled, semantic table primitives
Data Tablenpx shadcn@latest add tableSorting, filtering, pagination and selection — Table + TanStack Table
Chartnpx shadcn@latest add chartThemed charts, built on Recharts
Cardnpx shadcn@latest add cardGrouping related content and actions on a bordered surface
Itemnpx shadcn@latest add itemA list row with media, title, description and trailing actions
Badgenpx shadcn@latest add badgeStatus, categories, counts and tags
Avatarnpx shadcn@latest add avatarA user photo with a fallback to initials or an icon
TypographyUtility-class recipes for long-form content

Feedback and status

ComponentInstallUse it for
Alertnpx shadcn@latest add alertInline callouts for notes, warnings and errors
Toast (Sonner)npx shadcn@latest add sonnerBrief, non-blocking notifications that dismiss themselves
Progressnpx shadcn@latest add progressHow far a determinate task has advanced
Spinnernpx shadcn@latest add spinnerAn indeterminate loading indicator
Skeletonnpx shadcn@latest add skeletonAn animated placeholder while content loads
Emptynpx shadcn@latest add emptyAn empty state with icon, title, description and next action

Conversation and AI interfaces

ComponentInstallUse it for
Messagenpx shadcn@latest add messageA single turn in a conversation
Message Scrollernpx shadcn@latest add message-scrollerA chat scroll container that anchors turns and follows streamed responses
Markernpx shadcn@latest add markerAn inline status, system note or labeled separator in a thread

Where to go next

  • Component overview — the same list with full pages: every variant, prop table, accessibility notes and copy-paste examples.
  • Base UI vs Radix — which primitive to build against, and where the two APIs differ.
  • ShadcnStore blocks — these components already assembled into hero sections, pricing tables, dashboards, checkout forms and data tables.
  • Templates — complete Next.js applications built from them.

FAQ

How do I install every shadcn component at once?

Pass every component name to a single npx shadcn@latest add call — the full command is at the top of this page. The CLI resolves shared dependencies once, so it is faster than adding them one at a time.

Does npx shadcn@latest add overwrite my existing components?

It prompts before overwriting a file that already exists. Pass --overwrite to skip the prompt and replace them, or answer no to keep your version.

Which components need extra dependencies?

Calendar pulls in react-day-picker, Carousel pulls in Embla, Drawer pulls in Vaul, Chart pulls in Recharts, Command pulls in cmdk, Form pulls in React Hook Form and Zod, and Data Table expects TanStack Table. The CLI installs each of these for you.

Are these for Base UI or Radix?

Both. shadcn ships both primitives and every component page here documents the API for each, flagging the places they differ. Base UI vs Radix explains how to choose.