Skip to main content

components.json

The components.json file holds configuration for your project. We use it to understand how your project is set up and how to generate components customized for your project.
This file is created automatically when you run shadcn init. You can also create it manually.

Schema

You can use the JSON schema to get IntelliSense in your editor:
{
  "$schema": "https://ui.shadcn.com/schema.json"
}

Configuration

Here’s a complete example of a components.json file:
components.json
{
  "$schema": "https://ui.shadcn.com/schema.json",
  "style": "new-york",
  "rsc": true,
  "tsx": true,
  "tailwind": {
    "config": "tailwind.config.js",
    "css": "app/globals.css",
    "baseColor": "neutral",
    "cssVariables": true,
    "prefix": ""
  },
  "aliases": {
    "components": "@/components",
    "utils": "@/lib/utils",
    "ui": "@/components/ui",
    "lib": "@/lib",
    "hooks": "@/hooks"
  },
  "iconLibrary": "lucide",
  "registries": {}
}

Properties

$schema

$schema
string
URL to the JSON schema for IntelliSense and validation.
{
  "$schema": "https://ui.shadcn.com/schema.json"
}

style

style
string
required
The style for your components. Available styles: default or new-york.
{
  "style": "new-york"
}
The style determines the design and feel of your components. The “new-york” style features a more modern, refined aesthetic.

rsc

rsc
boolean
default:"false"
Whether to use React Server Components.
{
  "rsc": true
}
When set to true, components will be optimized for React Server Components. Use "use client" directives will be added where necessary.

tsx

tsx
boolean
default:"true"
Whether to use TypeScript.
{
  "tsx": true
}
When set to false, components will be generated as .jsx files instead of .tsx.

tailwind

tailwind
object
required
Configuration for Tailwind CSS.

aliases

aliases
object
required
Import aliases for your project.
{
  "aliases": {
    "components": "@/components",
    "utils": "@/lib/utils",
    "ui": "@/components/ui",
    "lib": "@/lib",
    "hooks": "@/hooks"
  }
}
These aliases must match the path mappings in your tsconfig.json or jsconfig.json.

iconLibrary

iconLibrary
string
The icon library to use. Options: lucide or radix.
{
  "iconLibrary": "lucide"
}
If not specified, defaults to lucide for the default style and radix for the new-york style.

rtl

rtl
boolean
default:"false"
Enable right-to-left (RTL) support.
{
  "rtl": true
}
When enabled, components will be optimized for RTL languages like Arabic and Hebrew.
menuColor
string
default:"default"
The color mode for menus. Options: default or inverted.
{
  "menuColor": "inverted"
}
menuAccent
string
default:"subtle"
The accent style for menus. Options: subtle or bold.
{
  "menuAccent": "bold"
}

registries

registries
object
Custom component registries.
{
  "registries": {
    "@acme": "https://registry.acme.com/{name}.json",
    "@v0": {
      "url": "https://api.v0.dev/registry/{name}.json",
      "headers": {
        "Authorization": "Bearer ${V0_TOKEN}"
      }
    }
  }
}
Registry names must start with @. Each registry can be:
  1. Simple string format: URL template with {name} placeholder
  2. Advanced object format: URL with optional authentication
Built-in registries (@shadcn, @v0, etc.) cannot be overridden.

Examples

{
  "$schema": "https://ui.shadcn.com/schema.json",
  "style": "new-york",
  "rsc": true,
  "tsx": true,
  "tailwind": {
    "config": "tailwind.config.js",
    "css": "app/globals.css",
    "baseColor": "neutral",
    "cssVariables": true
  },
  "aliases": {
    "components": "@/components",
    "utils": "@/lib/utils"
  }
}

Path Aliases

The CLI uses the aliases defined in components.json to generate imports. Make sure these match your tsconfig.json or jsconfig.json:
{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"]
    }
  }
}

Validation

The components.json file is validated against the schema. You can view the full schema at:
https://ui.shadcn.com/schema.json
Use the $schema property to get IntelliSense and validation in VS Code and other editors that support JSON Schema.

Build docs developers (and LLMs) love