Registry
Source of truth for all registry items. Follows bundle-based architecture.
Registry Structure
src/registry/
├── [bundle]/
│ ├── ui/ # Composable building blocks (registry:ui)
│ ├── components/ # Opinionated UI pieces (registry:component)
│ ├── blocks/ # Full sections/pages (registry:block)
│ ├── examples/ # Demos for ui/components (registry:example)
│ ├── hooks/ # Reusable hooks (registry:hook)
│ ├── styles/ # Semantic tokens (registry:style)
│ └── registry.ts # Bundle entrypoint, combines all items in the bundle into a single TypeScript registry object
└── index.ts # Main registry (combines all bundles, the real **source of truth**)
Bundles: pro-marketing
Adding Items (Quick Flow)
- Create source file in correct folder
- Create example file (for ui/components only)
- Add entry to
[bundle]/[type]/_registry.ts(alphabetical order) - Run
pnpm registry:build
For full details: docs/REGISTRY.md
Key Files
| File | Purpose |
|---|---|
index.ts | Main registry entrypoint |
[bundle]/registry.ts | Bundle entrypoint |
[bundle]/[type]/_registry.ts | Type-specific item definitions |
Internal Dependencies
Use namespaced keys for registry items depending on other items:
import { getNamespacedRegistryDependency, getNamespacedRegistryDependencies } from "@/utils/registry"
registryDependencies: [
"button", // shadcn default
getNamespacedRegistryDependency("announcement"), // → @shadcraft/announcement
...getNamespacedRegistryDependencies("chip", "tagline"), // → @shadcraft/chip, @shadcraft/tagline
]
Build Command
pnpm registry:build
Auto-Generated Files (DO NOT EDIT)
| File | Generated By |
|---|---|
__index__.tsx | pnpm registry:build |
registry.json (root) | pnpm registry:build |
public/r/*.json | pnpm registry:build |