Installation
Install and configure shadcn/ui in your project.You can use the CLI to automatically install and configure components. The
init command will guide you through the setup process.Quick Start
The fastest way to get started is to use thecreate command:
- Prompt you to choose a framework (Next.js, Vite, or TanStack Start)
- Create a new project with shadcn/ui pre-configured
- Install all dependencies
- Set up your design system
Manual Installation
If you have an existing project, you can add shadcn/ui components using theinit command:
Run the init command
Run the This will:
shadcn init command to setup your project:- Detect your framework
- Prompt you to configure
components.json - Install dependencies
- Set up Tailwind CSS
- Configure import aliases
Configure components.json
You’ll be asked a few questions to configure your project:This creates a
components.json file in your project root:Framework-Specific Guides
We provide detailed installation guides for popular frameworks:Next.js
Install shadcn/ui in a Next.js project (App Router or Pages Router)
Vite
Install shadcn/ui in a Vite React project
Remix
Install shadcn/ui in a Remix project
Astro
Install shadcn/ui in an Astro project
Laravel
Install shadcn/ui with Laravel and Inertia
Gatsby
Install shadcn/ui in a Gatsby project
Using Default Options
You can use the--defaults flag to skip the configuration prompts and use sensible defaults:
- Use TypeScript
- Use the “New York” style
- Use “neutral” as the base color
- Use CSS variables for theming
- Set up standard import aliases
Installation Options
Theinit command supports several options:
The template to use (next, vite, start, next-monorepo)
The base color to use (neutral, gray, zinc, stone, slate)
Skip confirmation prompts
Use default configuration
Force overwrite of existing configuration
The working directory (defaults to current directory)
Use the src directory when creating a new project
Use CSS variables for theming
Enable RTL (right-to-left) support
Example Usage
What Gets Installed?
When you runinit, the CLI will:
- Install dependencies - Installs Tailwind CSS and other required packages
- Create components.json - Configuration file for your project
- Set up globals.css - Adds CSS variables and base styles
- Configure tailwind.config.js - Updates Tailwind configuration
- Create utils file - Adds the
cn()utility function
Next Steps
After installation:- Browse components to see what’s available
- Add your first component using the CLI
- Configure components.json to customize your setup
- Learn about theming to customize colors and styles