Docs
Configuration
The CLI reads a single file — components.json at your project root — to learn where to write components, which import paths to generate, and which registries to resolve. Get this file right once and every install after it just works.
What components.json controls#
- style — the base component style (DavinciUI uses
new-york). - tailwind / cssVariables — whether components use CSS-variable-driven theming.
- aliases — the import paths generated in installed files. These must match your
tsconfig.jsonpaths. - registries — named URL templates so the CLI can resolve
@davinciui/*.
Info
Minimal working configuration#
Generated by pnpm dlx shadcn@latest init, then extended with the DavinciUI registry. The annotated fields below are the ones that matter for DavinciUI:
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "",
"css": "app/globals.css",
"baseColor": "neutral",
"cssVariables": true
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui"
},
"registries": {
"@davinciui": "https://davinciui.com/r/{name}.json"
}
}tailwind.csspoints at the stylesheet holding your theme tokens.tailwind.cssVariables: truekeeps components theme-aware (see Theming).rsc / tsxreflect a React Server Components + TypeScript project.
Registry configuration#
The namespace scopes third-party registries so names never clash with your local components. {name} is a placeholder the CLI replaces with the component slug:
{
"registries": {
"@davinciui": "https://davinciui.com/r/{name}.json"
}
}Why this matters: without it, shadcn add @davinciui/text-morph has nowhere to download from. How resolution works is covered in Registry.
Alias configuration#
Aliases decide the import paths written into installed files. They must match the paths in your tsconfig.json:
{
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui"
}
}Typical mapping: @/components → ./components. If you use a different prefix (for example ~/), set it here and in tsconfig.json together.
Project structure and installation destination#
With the aliases above, installing @davinciui/text-morph writes to:
components/
ui/
text-morph.tsx # installed source — yours to edit
lib/
utils.ts # cn() helper (created by shadcn init)Imports in the installed file reference @/components/ui/… and @/lib/utils exactly as configured — which is why aliases and tsconfig paths must agree.
Configuration for existing projects#
- Run
pnpm dlx shadcn@latest initin the existing repo and answer the prompts to match your setup. - Point
tailwind.cssat your real global stylesheet, not the default suggestion, if it differs. - Keep your existing path alias: if the project uses
~/instead of@/, configure that alias instead of renaming imports. - Add the
registriesblock manually if yourcomponents.jsonpredates it.
Validation checklist#
components.jsonexists at the project root and parses as JSON.registries["@davinciui"]equalshttps://davinciui.com/r/{name}.json.- Every alias in
components.jsonhas a matching entry intsconfig.jsonpaths. tailwind.csspoints at a stylesheet that exists and is imported by the app.- A test install (
add @davinciui/text-morph) lands files under the aliased directory.
Troubleshooting#
- CLI ignores your paths — you edited
tsconfig.jsonbut notcomponents.jsonaliases (or vice versa). Change both. - Styles missing after install —
tailwind.csspoints at the wrong file, or the stylesheet is not imported. Verify the path and the import. - Unthemed components —
cssVariablesis false. Set it to true and see Theming.
Full spec at ui.shadcn.com/docs/components-json.

