What problem does it solve?
Developing consistent, accessible, and highly customizable UI components from scratch is time-consuming. shadcn/ui provides a robust foundation built on Radix UI and Tailwind CSS, accelerating UI development.
Core Features & Use Cases
- Composable UI Library: Access a collection of pre-built, unstyled Radix UI primitives with Tailwind CSS for rapid UI assembly.
- Variant-Based Styling (CVA): Define component variations (e.g.,
primary, secondary buttons; small, large sizes) using class-variance-authority for consistent theming.
- Polymorphic Components (
asChild): Render components as different HTML elements (e.g., a Button as an <a> tag) while retaining styling and accessibility.
- Use Case: Quickly prototype and build a modern web application's frontend, ensuring design consistency and accessibility across all interactive elements like forms, dialogs, and navigation.
Quick Start
Explain how to use the cn() utility and a basic CVA pattern to create a button component with default and outline variants.