Skip to content

lenxism/tocn

Repository files navigation

toc-cn — shadcn component registry

Custom shadcn/ui registry for building and sharing components.

Based on the official registry-template.

Quick start

pnpm install
pnpm dev

Open http://localhost:3000 to preview components.

Add a new component

  1. Create source files under registry/new-york/blocks/your-component/
  2. Use @/components/ui/* imports (not relative paths)
  3. Register the item in registry.json
  4. Rebuild and preview:
pnpm registry:build
pnpm dev

Install in another project

After 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

Scripts

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)

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.

Publish to the shadcn directory

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

Docs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors