Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rotten-humans-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"shadcn": minor
---

add include to registry.json
File renamed without changes.
1 change: 0 additions & 1 deletion apps/v4/content/docs/(root)/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"[CLI](/docs/cli)",
"monorepo",
"skills",
"v0",
"javascript",
"blocks",
"figma",
Expand Down
98 changes: 98 additions & 0 deletions apps/v4/content/docs/changelog/2026-05-registry-include.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
title: May 2026 - Registry Include
description: Organize large registries with included registry.json files.
date: 2026-05-20
---

We've added support for `include` in `registry.json`.

Registry authors can now organize a large source registry across multiple
`registry.json` files and compose them with `shadcn build`.

```txt
registry.json
components
└── ui
├── button.tsx
├── input.tsx
└── registry.json
hooks
├── registry.json
├── use-media-query.ts
└── use-toggle.ts
```

{/* prettier-ignore */}
```json title="registry.json" showLineNumbers
{
"$schema": "https://ui.shadcn.com/schema/registry.json",
"name": "acme",
"homepage": "https://acme.com",
"include": [
"components/ui/registry.json",
"hooks/registry.json"
]
}
```

Included `registry.json` files are valid registry files for composition and may
omit `name` and `homepage`. Only the root `registry.json` must define the
registry metadata.

```json title="components/ui/registry.json" showLineNumbers
{
"$schema": "https://ui.shadcn.com/schema/registry.json",
"items": [
{
"name": "button",
"type": "registry:ui",
"files": [
{
"path": "button.tsx",
"type": "registry:ui"
}
]
}
]
}
```

## Build output

`shadcn build` resolves included registries and writes a flattened
`registry.json` without `include`. Item file paths are preserved from the root
registry, so a file declared in `components/ui/registry.json` is written as
`components/ui/button.tsx` in the built registry item.

## Registry loaders

The `shadcn/registry` package also exports `loadRegistry` and
`loadRegistryItem` for dynamic registry routes.

```ts title="app/r/registry.json/route.ts" showLineNumbers
import { loadRegistry } from "shadcn/registry"

export async function GET() {
const registry = await loadRegistry()

return Response.json(registry)
}
```

```ts title="app/r/[name].json/route.ts" showLineNumbers
import { loadRegistryItem } from "shadcn/registry"

export async function GET(
_: Request,
{ params }: { params: Promise<{ name: string }> }
) {
const { name } = await params
const item = await loadRegistryItem(name)

return Response.json(item)
}
```

See the [registry.json documentation](/docs/registry/registry-json#include) and
[getting started guide](/docs/registry/getting-started#structure-your-registry)
for more details.
Loading
Loading