Reading the repo
Reading the repo
How to install on Windows
Composable, accessible components with thoughtful defaults. Build your own component library with code you can customize, extend, and make your own.
Saved setup from 10 h ago
Will it work on Windows?
Heads-upBuilding it yourself? It also needs 2 settings in .env.
CONTRIBUTING.mdThanks for your interest in contributing to ui.shadcn.com. We're happy to have you here.
Please take a moment to review this document before submitting your first pull request. We also strongly recommend that you check for open issues and pull requests to see if someone else is working on something similar.
If you need any help, feel free to reach out to @shadcn.
This repository is a monorepo.
workspaces for development.This repository is structured as follows:
apps
└── v4
├── app
├── components
├── content
└── registry
└── new-york-v4
├── example
└── ui
packages
└── shadcn
| Path | Description |
| -------------------- | ---------------------------------------- |
| apps/v4/app | The Next.js application for the website. |
| apps/v4/components | The React components for the website. |
| apps/v4/content | The content for the website. |
| apps/v4/registry | The registry for the components. |
| packages/shadcn | The shadcn package. |
| packages/registry | The @shadcn/registry package. |
You can fork this repo by clicking the fork button in the top right corner of this page.
git clone https://github.com/your-username/ui.git
cd ui
git checkout -b my-new-branch
pnpm install
You can use the pnpm --filter=[WORKSPACE] command to start the development process for a workspace.
ui.shadcn.com website:pnpm --filter=v4 dev
Fresh clone? The generated styles are not checked into git. Run
pnpm --filter=v4 registry:build --style allonce before starting the dev server. If you forget, the dev server will fail fast and tell you exactly this.
shadcn package:pnpm shadcn:dev
This also watches @shadcn/registry, which the CLI depends on.
To run the CLI locally, you can follow the workflow:
Start by running the dev server:
pnpm dev
In another terminal tab, test the CLI by running:
pnpm shadcn
To test the CLI in a specific app, use a command like:
pnpm shadcn <init | add | ...> -c ~/Desktop/my-app
This workflow ensures that you are running the most recent version of the registry and testing the CLI properly in your local environment.
The documentation for this project is located in the v4 workspace. You can run the documentation locally by running the following command:
pnpm --filter=v4 dev
Documentation is written using MDX. You can find the documentation files in the apps/v4/content/docs directory.
We use a registry system for developing components. You can find the source code for the components under apps/v4/registry. The components are organized by styles.
apps
└── v4
└── registry
└── new-york-v4
├── example
└── ui
When adding or modifying components, please ensure that:
pnpm registry:build to update the registry.See apps/v4/registry/README.md for how the
registry pipeline is structured and for the faster targeted build modes
(--style, --registry, --examples, --indexes) you can use while
iterating locally. Always run the full pnpm registry:build before committing.
Note that most generated output is not tracked in git: the installable JSON
under apps/v4/public/r/styles and the compiled styles under apps/v4/styles
are gitignored and rebuilt on every deploy. Running registry:build will not
dirty your working tree with generated files — only changes to the authored
sources (e.g. registry/bases) and the tracked indexes are committed.
Before you create a Pull Request, please check whether your commits comply with the commit conventions used in this repository.
When you create a commit we kindly ask you to follow the convention
category(scope or module): message in your commit message while using one of
the following categories:
feat / feature: all changes that introduce completely new code or new
features
fix: changes that fix a bug (ideally you will additionally reference an
issue if present)
refactor: any code related change that is not a fix nor a feature
docs: changing existing or creating new documentation (i.e. README, docs for
usage of a lib or cli usage)
build: all changes regarding the build of the software, changes to
dependencies or the addition of new dependencies
test: all changes regarding tests (adding new tests or changing existing
ones)
ci: all changes regarding the configuration of continuous integration (i.e.
github actions, ci system)
chore: all changes to the repository that do not fit into any of the above
categories
e.g. feat(components): add new prop to the avatar component
If you are interested in the detailed specification you can visit https://www.conventionalcommits.org/ or check out the Angular Commit Message Guidelines.
If you have a request for a new component, please open a discussion on GitHub. We'll be happy to help you out.
The shadcn package is a CLI for adding components to your project. You can find the documentation for the CLI here.
Changes to the CLI commands should be made in the packages/shadcn directory. The registry and install logic the CLI uses (fetching and resolving registry items, components.json, updaters and transformers) lives in packages/registry, published as @shadcn/registry. If you can, it would be great if you could add tests for your changes.
Tests are written using Vitest. You can run all the tests from the root of the repository.
pnpm test
Please ensure that the tests are passing when submitting a pull request. If you're adding new features, please include tests.
Then run powershell -ExecutionPolicy Bypass -File .\setup.ps1. It stops at the first error and is safe to run again. Servers and tests aren't started; it lists them at the end. Read it first.
Needs Git: winget install Git.Git
git clone https://github.com/shadcn-ui/ui.git cd ui
Node.js v20.5.1
winget install CoreyButler.NVMforWindows nvm install 20 nvm use 20
corepack enable pnpm install
pnpm dev
pnpm test
No reports for Windows yet.
Opens a chat with this manual already filled in, for Windows. It uses your own account; gitmanual sends nothing.