Docs/Next.js
Note: We have the exact same installation process as shadcn/ui.
Next.js
Install and configure Next.js.
Create project
Run the init
command to create a new Next.js project or to setup an existing one:
npx shadcn@latest init
You can use the -d
flag for defaults i.e new-york
, zinc
and yes
for the css variables.
npx shadcn@latest init -d
Configure components.json
You will be asked a few questions to configure components.json
:
Which style would you like to use? › New York
Which color would you like to use as base color? › Zinc
Where is your global CSS file? › app/globals.css
Do you want to use CSS variables for colors? › yes
Where is your tailwind.config.js located? › tailwind.config.js
Configure the import alias for components? › @/components
Configure the import alias for utils? › @/lib/utils
Are you using React Server Components? › yes
That's it!
You can now start adding components to your project. Run add
to add components:
npx shadcn@latest add button
For others frameworks visit here