Search

Search documentation

Shadcn Registry Reference

Quick reference for the shadcn/ui registry system - key concepts, workflows, and configuration.

This page serves as a quick refresher for the shadcn registry system. For complete documentation, visit the official shadcn registry docs.


What is a Registry?

A registry is a distribution system for code. It allows you to share components, hooks, pages, config files, and other code with any project using the shadcn CLI.

The registry works with any project type and any framework β€” not limited to React.


Key Files

registry.json

The entry point for your registry. Lists all items and metadata.

{
  "$schema": "https://ui.shadcn.com/schema/registry.json",
  "name": "evolphin",
  "homepage": "https://evolphin.com",
  "items": [
    // Your registry items
  ]
}
FieldDescription
nameRegistry namespace (e.g., evolphin, acme)
homepageYour registry's homepage URL
itemsArray of registry item definitions

Registry Item Types

Each item in your registry has a type that determines how it's resolved:

TypeDescriptionTarget Path
registry:uiUI componentscomponents/ui/
registry:componentGeneral componentscomponents/
registry:blockFull-page blocks/templatescomponents/
registry:hookReact hookshooks/
registry:libUtility librarieslib/
registry:pageFull pagesapp/ or pages/
registry:fileArbitrary filesCustom path
registry:themeTheme configurationsStyles
registry:styleStyle variants (e.g., new-york)-

Registry Item Schema

Each item in registry.json follows this structure:

{
  "name": "hello-world",
  "type": "registry:block",
  "title": "Hello World",
  "description": "A simple hello world component.",
  "files": [
    {
      "path": "registry/default/hello-world/hello-world.tsx",
      "type": "registry:component"
    }
  ],
  "dependencies": ["lucide-react"],
  "registryDependencies": ["button"]
}

Key Properties

PropertyRequiredDescription
nameβœ…Unique identifier for the item
typeβœ…Item type (see table above)
title❌Human-readable title
description❌Detailed description
filesβœ…Array of files to include
dependencies❌npm packages required
registryDependencies❌Other registry items required

Dependencies vs Registry Dependencies

dependencies

npm packages that will be installed:

{
  "dependencies": ["@radix-ui/react-accordion", "zod", "lucide-react@0.400.0"]
}

registryDependencies

Other registry items that will be added:

{
  "registryDependencies": [
    "button", // shadcn/ui component
    "@acme/input-form", // namespaced component
    "https://example.com/r/editor.json" // remote URL
  ]
}

Building Your Registry

1. Install CLI

bash pnpm add shadcn@latest
bash npm add shadcn@latest
bash yarn add shadcn@latest

2. Add Build Script

{
  "scripts": {
    "registry:build": "shadcn build"
  }
}

3. Run Build

bash pnpm registry:build
bash npm run registry:build
bash yarn registry:build

Output goes to public/r/ by default (e.g., public/r/hello-world.json).


Installing from Registry

Users can add items from your registry using:

npx shadcn@latest add https://your-registry.com/r/hello-world.json

Or with namespaces configured:

npx shadcn@latest add @evolphin/hello-world

Our Setup

In Evolphin UI, our registry is located at:

registry/
└── default/
    └── ui/
        β”œβ”€β”€ button.tsx
        β”œβ”€β”€ card.tsx
        β”œβ”€β”€ dialog.tsx
        └── ...

We use the default style variant and components are available via:

import { Button } from "@/registry/default/ui/button";

On this page