This is a template for creating a custom registry using Next.js. Powered by Fumadocs & Shadcn.
- create a
component&lib&hookin registry folder - add it in
registry.json - build the registry
pnpm run registry:build- serve the registry
pnpm run dev- open the browser and navigate to
http://localhost:3000/r/utils.json
you should see the utils json file
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "utils",
"type": "registry:lib",
"title": "Utils",
"description": "A library to utils functions",
"files": [
{
"path": "registry/utils/index.ts",
"content": "export async function sleep(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}",
"type": "registry:lib"
}
]
}if you want to share it you should deploy it to a public network which can be accessed by anyone.
pnpm dlx shadcn@latest add https://marvin-season.github.io/registry-template/r/example-form.jsonor config registry in components.json
{
"$schema": "https://ui.shadcn.com/schema.json",
// ...
"registries": {
"@registry": "https://marvin-season.github.io/registry-template/r/{name}.json"
}
}pnpm dlx shadcn@latest add @template/example-formFumadocs is a documentation tool for React. It is a modern, lightweight, and easy-to-use documentation tool that allows you to create beautiful documentation for your React projects.