Skip to main content
Until now, using shadcn/ui in a monorepo was a bit of a pain. You could add components using the CLI, but you had to manage where the components were installed and manually fix import paths. With the new monorepo support in the CLI, we’ve made it a lot easier to use shadcn/ui in a monorepo. The CLI now understands the monorepo structure and will install the components, dependencies and registry dependencies to the correct paths and handle imports for you.

Getting started

File Structure

When you create a new monorepo project, the CLI will create the following file structure:

Requirements

  1. Every workspace must have a components.json file. A package.json file tells npm how to install the dependencies. A components.json file tells the CLI how and where to install components.
  2. The components.json file must properly define aliases for the workspace. This tells the CLI how to import components, hooks, utilities, etc.
apps/web/components.json
packages/ui/components.json
  1. Ensure you have the same style, iconLibrary and baseColor in both components.json files.
  2. For Tailwind CSS v4, leave the tailwind config empty in the components.json file.
By following these requirements, the CLI will be able to install ui components, blocks, libs and hooks to the correct paths and handle imports for you.