āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā š shadcn/directory/crafter-station/elements/registry_quick_start ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
# Start dev server
bun dev
# Build registry (generates all JSON files)
bun run build:registry
# Regenerate registry index only
bun run registry:index
# Build entire project (includes registry build)
bun run build
# Test a specific component locally
npx shadcn add http://localhost:3000/r/clerk-sign-in-shadcn.json
# Or from production
npx shadcn add https://tryelements.dev/r/clerk-sign-in-shadcn.json
mkdir -p registry/default/blocks/[provider]/[component-name]
registry/default/blocks/[provider]/[component-name]/
āāā registry-item.json # Required: Component manifest
āāā components/ # React components
ā āāā my-component.tsx
āāā lib/ # Utilities
ā āāā utils.ts
āāā hooks/ # Custom hooks (optional)
ā āāā use-my-feature.ts
āāā api/ # API routes (optional)
āāā route.ts
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "my-component",
"type": "registry:block",
"title": "My Component",
"description": "A description of what this does",
"registryDependencies": [
"button",
"card"
],
"dependencies": [
"some-npm-package@^1.0.0"
],
"files": [
{
"path": "registry/default/blocks/[provider]/[component-name]/components/my-component.tsx",
"type": "registry:component"
}
],
"envVars": {
"MY_API_KEY": ""
},
"docs": "Additional usage notes"
}
bun run build:registry
Your component is now available at public/r/my-component.json!
| Type | Use Case | Target Path |
|------|----------|-------------|
| registry:block | Complex multi-file components | components/blocks/ |
| registry:component | Simple components | components/ |
| registry:ui | UI primitives | components/ui/ |
| registry:hook | Custom hooks | hooks/ |
| registry:lib | Utilities | lib/ |
| registry:page | Full pages | Specified by target |
| registry:file | Generic files | Specified by target |
{
"registryDependencies": [
"@elements/clerk-middleware",
"@elements/apple-logo"
]
}
{
"registryDependencies": [
"button",
"card",
"input"
]
}
{
"dependencies": [
"@clerk/nextjs@^6.0.0",
"motion@^12.0.0"
]
}
// ā
Use @/registry for internal components
import { MyUtil } from "@/registry/default/blocks/provider/component/lib/utils"
// ā
Use @/ for external dependencies
import { Button } from "@/components/ui/button"
import { cn } from "@/lib/utils"
// ā Don't use relative imports
import { MyUtil } from "../lib/utils" // Wrong!
elements/
āāā registry/ # New shadcn structure
ā āāā index.ts # Auto-generated
ā āāā utils.ts # Helper functions
ā āāā default/
ā āāā blocks/
ā āāā clerk/
ā āāā tinte/
ā āāā polar/
ā āāā ...
ā
āāā src/registry/ # Old structure (kept for reference)
ā āāā ...
ā
āāā public/r/ # Build output
ā āāā registry.json # Main index
ā āāā *.json # Component files
ā
āāā scripts/
āāā build-registry.ts # Main build script
āāā generate-registry-index.ts # Index generator
āāā ...
# Make sure all dependencies are installed
bun install
# Clean and rebuild
rm -rf public/r/*
bun run build:registry
# Regenerate the registry index
bun run registry:index
# Then rebuild
bun run build:registry
Check that your registry-item.json uses correct paths:
{
"files": [
{
"path": "registry/default/blocks/provider/component/file.tsx"
}
]
}
Current registry size:
http://localhost:3000/r/registry.jsonhttp://localhost:3000/r/[name].jsonhttps://tryelements.dev/r/registry.jsonhttps://tryelements.dev/r/[name].jsonbun run build:registry after modifying any registry-item.json@elements/ for brand recognitiondocs field to each registry-item.jsonREGISTRY_MIGRATION_SUMMARY.mdHappy building! š
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā