Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/shadcn-ui/ui/llms.txt

Use this file to discover all available pages before exploring further.

You can use the shadcn CLI to run your own code registry. Running your own registry allows you to distribute your custom components, hooks, pages, config, rules and other files to any project.
The registry works with any project type and any framework, and is not limited to React.

What is a Registry?

A registry is a distribution system for code. It allows you to package and share reusable code components, utilities, hooks, configuration files, and other resources across projects and teams. Think of it as your own npm registry, but for code snippets and components that can be installed directly into your project with proper dependency resolution and configuration.

Key Features

Framework Agnostic

Works with any project type - React, Vue, Svelte, PHP, or any framework that supports serving JSON over HTTP.

Dependency Resolution

Automatically resolves and installs both npm packages and registry dependencies.

Type Support

Support for multiple resource types: components, hooks, utilities, pages, themes, and more.

Namespaces

Organize resources with namespaces for better organization and conflict prevention.

How It Works

The registry system follows a simple architecture:
1

Define Your Components

Create your components, hooks, or utilities in your project following the registry/[STYLE]/[NAME] directory structure.
2

Configure Registry Items

Define each item in your registry.json file with metadata including name, type, dependencies, and file paths.
3

Build the Registry

Run the shadcn build command to generate individual JSON files for each registry item.
4

Serve and Distribute

Deploy your registry to a public URL and share with your team or the community.

Registry Architecture

A registry consists of two main components:

1. Registry Index (registry.json)

The entry point that defines your registry’s name, homepage, and lists all available items:
registry.json
{
  "$schema": "https://ui.shadcn.com/schema/registry.json",
  "name": "acme",
  "homepage": "https://acme.com",
  "items": [
    {
      "name": "hello-world",
      "type": "registry:block",
      "title": "Hello World",
      "description": "A simple hello world component.",
      "files": [
        {
          "path": "registry/new-york/hello-world/hello-world.tsx",
          "type": "registry:component"
        }
      ]
    }
  ]
}

2. Registry Items

Individual JSON files for each component or resource, generated from your registry.json during the build process. These files contain:
  • Component source code
  • Dependencies (npm packages)
  • Registry dependencies (other registry items)
  • CSS variables and theming
  • Environment variables
  • Type definitions

Use Cases

Company Component Library

Create a private registry for your organization’s design system and shared components:
npx shadcn@latest add https://registry.acme.com/r/auth-form.json

Open Source Projects

Share your components with the community by publishing a public registry:
npx shadcn@latest add @yourname/custom-carousel

Multi-Team Collaboration

Organize registries by team or department using namespaces:
{
  "registries": {
    "@design": "https://design.company.com/registry/{name}.json"
  }
}

AI Resources

Distribute AI prompts, rules, and configurations:
npx shadcn@latest add @ai/chatbot-rules

What You Can Distribute

Registries support multiple resource types:
TypeDescriptionExample Use Case
registry:componentSimple componentsButton, Input, Card
registry:blockComplex multi-file componentsDashboard, Auth forms
registry:uiUI primitivesDialog, Dropdown, Tooltip
registry:hookCustom React hooksuseAuth, useLocalStorage
registry:libUtilities and helpersDate formatters, validators
registry:pageFull page templatesLogin, Dashboard, Settings
registry:themeTheme configurationsDark mode, Brand themes
registry:styleComplete style systemsDesign system styles
registry:fileMiscellaneous filesConfig files, constants

Getting Started

Ready to create your own registry? Head over to the getting started guide to build your first registry.

Getting Started

Learn how to set up and build your own component registry step-by-step.

Additional Resources

Authentication

Secure your registry with authentication

Namespaces

Configure registries with namespaces

Examples

Registry item examples and configurations

Schema Reference

Schema specification for registry.json

Build docs developers (and LLMs) love