# scn-stack — Full Documentation > Scaffold a complete shadcn component registry with documentation in minutes. Website: https://scnstack.sh GitHub: https://github.com/jal-co/scn-stack npm: https://www.npmjs.com/package/create-scn-stack --- ## Quick Start > Create your first shadcn registry in minutes. > Source: https://scnstack.sh/docs ## Get Started ### Prerequisites - **Node.js 18+** — [Download from nodejs.org](https://nodejs.org/) - **Git** — [Download from git-scm.com](https://git-scm.com/) ### Create a Registry ```bash npx create-scn-stack ``` Follow the interactive prompts to configure your registry. Or skip prompts entirely: ```bash npx create-scn-stack my-ui --yes ``` Want to share items straight from a public repo with **no build, no host, and no server**? Scaffold a [GitHub source registry](/docs/distribution/github-registries) instead — users install with `npx shadcn add //`: ```bash npx create-scn-stack my-toolkit --github acme/toolkit ``` The CLI will: 1. Ask you for a registry name, framework, docs engine, and more 2. Generate all project files with the registry `include` pattern 3. Create starter components with live preview demos 4. Set up theme scaffolding and v0 integration 5. Generate `llms.txt` and `.scn-stack.json` config 6. Install dependencies and the shadcn AI skill 7. Initialize a git repository ### Add to an Existing Project Already have a project? Add a registry to it: ```bash npx create-scn-stack init ``` This detects your framework, creates `registry.json`, `components.json`, adds a `registry:build` script, and optionally scaffolds documentation. See [init command](/docs/cli/options#init) for details. ### Start Development ```bash cd my-ui pnpm dev ``` Your registry is now running at `http://localhost:3000` with: - A **landing page** with install instructions - **Documentation** with live component previews - **Registry endpoints** at `/r/registry.json` ### Add Components, Hooks & Blocks ```bash npx create-scn-stack add-component input -d "A text input component." npx create-scn-stack add-hook use-toggle -d "A toggle state hook." npx create-scn-stack add-block login-form -d "A login form block." ``` Each command creates the source file, adds it to `registry.json`, generates a doc page, and updates navigation — all in one command. ### Build & Validate ```bash npx shadcn registry validate pnpm registry:build ``` This validates your registry schema and generates static JSON files in `public/r/`. ### Deploy Deploy to Vercel, Netlify, or any platform that supports your framework. Your registry is a standard web app — no special hosting required. Once deployed, anyone can install your components: ```bash npx shadcn add @my-ui/button ``` ## What is a shadcn Registry? A [shadcn registry](https://ui.shadcn.com/docs/registry) is a way to distribute components, hooks, blocks, and other code that users can install with the `shadcn` CLI. Unlike npm packages, registry components are **copied into the user's project** as source code they own and can customize. It's the same pattern that `shadcn/ui` itself uses. ### Why Build a Registry? - **Design systems** — distribute your company's component library - **Open source** — share themed or specialized components with the community - **Internal tools** — standardize UI across projects in your org - **Commercial** — sell premium component collections ## Next Steps - [CLI Options](/docs/cli/options) — all prompts, flags, and commands - [Project Structure](/docs/project-structure) — what gets generated - [Frameworks](/docs/frameworks/nextjs) — framework-specific details --- ## Project Structure > What gets generated and where everything goes. > Source: https://scnstack.sh/docs/project-structure ## Overview After running `npx create-scn-stack`, you'll get a fully configured project. Here's the structure for a **Next.js + Fumadocs** setup with essentials: ## Key Files ### registry.json (Root) The root registry uses the `include` pattern to compose from per-directory files: ```json { "$schema": "https://ui.shadcn.com/schema/registry.json", "name": "my-ui", "homepage": "https://my-ui.com", "include": [ "registry/new-york/ui/registry.json", "registry/new-york/themes/registry.json" ] } ``` ### registry/\/ui/registry.json Per-directory registry defining each component. File paths are relative to this file: ```json { "$schema": "https://ui.shadcn.com/schema/registry.json", "items": [ { "name": "button", "type": "registry:ui", "title": "Button", "description": "A button component with multiple variants.", "dependencies": ["class-variance-authority"], "files": [ { "path": "button.tsx", "type": "registry:ui" } ] } ] } ``` ### components.json The shadcn configuration for your project. Includes your style, aliases, and namespace. ```json { "$schema": "https://ui.shadcn.com/schema.json", "style": "new-york", "rsc": true, "tsx": true, "aliases": { "components": "@/components", "utils": "@/lib/utils", "ui": "@/components/ui", "lib": "@/lib", "hooks": "@/hooks" }, "iconLibrary": "lucide", "registries": { "@my-ui": "https://my-ui.com/r/{name}.json" } } ``` ### .scn-stack.json Stores your project's scaffolding configuration for repeatable operations. Used by `add-component`, `add-hook`, and `add-block` commands. ```json { "$schema": "https://scnstack.sh/schema/scn-stack.json", "name": "my-ui", "style": "new-york", "homepage": "https://my-ui.com", "framework": "nextjs", "docsEngine": "fumadocs", "baseLibrary": "radix", "namespace": "@my-ui", "features": { "skills": true } } ``` ### Component Previews Each component doc page includes a live preview using `ComponentPreview` and demo files that import directly from the registry source: ```tsx import { ComponentPreview } from "@/components/component-preview" import { ButtonDemo } from "@/components/examples/button-demo" ``` For iframe-based previews (useful for isolated rendering), use the `PreviewFrame` component: ```tsx import { PreviewFrame } from "@/components/preview-frame" ``` This renders the component at `/preview/button` in an iframe. Add your demos to the `PREVIEWS` map in `app/preview/[name]/page.tsx`. ### v0 Integration The generated project includes an "Open in v0" button component and a URL helper: ```tsx import { OpenInV0 } from "@/components/open-in-v0" ``` This links to [v0.dev](https://v0.dev) with a pre-filled prompt referencing your registry component. ### Theme A custom theme is scaffolded in `registry/