CLI
Use the CLI to add components, blocks and pages to your project.
We rely on shadcn CLI to add components and blocks to your project.
The CLI provides an easy, interactive way to add components, blocks and pages to your project. Installing components using the CLI ensures that you have the latest version of the component and its dependencies.
init command
You can use the init command to initialize configuration and dependencies for a new project.
The init command installs dependencies, adds the cn util and configures CSS variables for the project.
You will be asked a few questions to initialize the project.
add command
You can use the add command to add components, blocks and pages to your project.
The add command installs dependencies, adds the component, block or page to your project and updates the configuration.
You can use the same command to add shadcn/ui components.
To see a list of all available options, please refer to the shadcn/ui documentation.
Monorepo support
If you need to install the components in a monorepo, you can use the optional -c flag.
This will allow you to specify the path to the project where you want to install the component.
Read more about monorepo support using the shadcn CLI in the shadcn/ui documentation.