Custom shadcn/ui registry for building and sharing components.
Based on the official registry-template.
pnpm install
pnpm devOpen http://localhost:3000 to preview components.
- Create source files under
registry/new-york/blocks/your-component/ - Use
@/components/ui/*imports (not relative paths) - Register the item in
registry.json - Rebuild and preview:
pnpm registry:build
pnpm devAfter deploying (or locally while pnpm dev is running):
npx shadcn add http://localhost:3000/r/table-of-contents.json
# or production:
npx shadcn add https://tocn.vercel.app/r/table-of-contents.json
# or after directory listing:
npx shadcn add @toc-cn/table-of-contents| Command | Description |
|---|---|
pnpm dev |
Start preview app |
pnpm registry:build |
Generate public/r/*.json for the CLI |
pnpm build |
Build registry + Next.js (for deploy) |
Push to GitHub and deploy on Vercel. The prebuild script runs shadcn build automatically.
Set NEXT_PUBLIC_BASE_URL to your production URL for the "Open in v0" button.
Once live and open source, submit a PR to the registry index. See docs/directory-submission.md for the exact entry and checklist.
npx shadcn add @toc-cn/table-of-contents