components.json
Thecomponents.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:Configuration
Here’s a complete example of acomponents.json file:
components.json
Properties
$schema
URL to the JSON schema for IntelliSense and validation.
style
The style for your components. Available styles: The style determines the design and feel of your components. The “new-york” style features a more modern, refined aesthetic.
default or new-york.rsc
Whether to use React Server Components.When set to
true, components will be optimized for React Server Components. Use "use client" directives will be added where necessary.tsx
Whether to use TypeScript.When set to
false, components will be generated as .jsx files instead of .tsx.tailwind
Configuration for Tailwind CSS.
aliases
Import aliases for your project.These aliases must match the path mappings in your
tsconfig.json or jsconfig.json.iconLibrary
The icon library to use. Options:
lucide or radix.lucide: Uses Lucide Iconsradix: Uses Radix Icons
lucide for the default style and radix for the new-york style.rtl
Enable right-to-left (RTL) support.When enabled, components will be optimized for RTL languages like Arabic and Hebrew.
menuColor
The color mode for menus. Options:
default or inverted.menuAccent
The accent style for menus. Options:
subtle or bold.registries
Custom component registries.Registry names must start with
@. Each registry can be:- Simple string format: URL template with
{name}placeholder - Advanced object format: URL with optional authentication
Examples
Path Aliases
The CLI uses the aliases defined incomponents.json to generate imports. Make sure these match your tsconfig.json or jsconfig.json:
Validation
Thecomponents.json file is validated against the schema. You can view the full schema at: