# Registry

How this registry is structured and how to consume it with the shadcn CLI.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown variants are available by appending `.md` to any URL or sending an `Accept: text/markdown` header. An agent skill is available at [/.well-known/agent-skills/site-skill.md](/.well-known/agent-skills/site-skill.md).



This project is a [shadcn registry](https://ui.shadcn.com/docs/registry) — a
collection of components distributed as source code over HTTP. The `shadcn` CLI reads
a JSON descriptor for each item and copies the files straight into your project.

## Installing an item [#installing-an-item]

Point the CLI at any item's JSON URL:

```bash
npx shadcn@latest add https://shadcn-cssinjs.com/r/button.json
```

The CLI resolves dependencies, installs npm packages, and writes the files to
`components/ui/<name>/`. You own the code from that point on.

## Registry structure [#registry-structure]

Each item is declared in `registry.json` and built into a static JSON file under
`public/r/`. A typical entry looks like this:

```json title="registry.json"
{
  "name": "button",
  "type": "registry:ui",
  "dependencies": ["@base-ui/react", "@stylexjs/stylex"],
  "files": [
    {
      "path": "registry/bases/stylex/ui/button.tsx",
      "type": "registry:ui",
      "target": "components/ui/button.tsx"
    }
  ],
  "registryDependencies": ["stylex-tokens", "stylex-utils"]
}
```

* **`dependencies`** — npm packages the CLI installs for you.
* **`registryDependencies`** — other items in this registry that get pulled in
  automatically. Every component depends on `stylex-tokens`, which installs the
  shared `tokens.stylex.ts`.
* **`files`** — each component ships its `.tsx` and `.stylex.ts` side by side.

## Shared tokens [#shared-tokens]

The `stylex-tokens` item is a `registry:lib` that installs
`components/ui/tokens.stylex.ts`. It is the single source of truth for theming and is a
`registryDependency` of nearly every component, so you rarely install it by hand. See
[Theming](/docs/theming) for details.

## Building the registry [#building-the-registry]

If you fork this project, regenerate the `public/r/*.json` files after editing
`registry.json`:

```bash
pnpm registry:build
```

<Callout>
  Want to publish your own registry? Follow the official [registry
  guide](https://ui.shadcn.com/docs/registry/getting-started) — the same `shadcn
    build` pipeline powers this site.
</Callout>
