Project shape#
Tailwind v3 projects also include tailwind.config.js and postcss.config.js.
JavaScript-first contract#
The scaffold deliberately avoids TypeScript-shaped output:
components.jsonhas"tsx": falseand"rsc": false.- shadcn components are generated as
.jsxfiles. - The
cn()helper lives insrc/lib/utils.js; anyutils.tsis removed. jsconfig.jsonprovidesbaseUrland@/*paths for editors.vite.config.jsresolves@to./src.
The CLI validates the shadcn output before reporting success. If components.json, the stylesheet, theme variables, or declared dependencies are missing, it exits with an error.
Tailwind v4 (default)#
| Piece | Value |
|---|---|
| Tailwind | tailwindcss@4 |
| Vite integration | @tailwindcss/vite@4 |
| shadcn CLI | shadcn@4 |
| CSS entry | @import "tailwindcss"; |
shadcn writes the theme variables into src/index.css. The CLI verifies that real --background and --primary values exist.
Tailwind v3 (legacy)#
| Piece | Value |
|---|---|
| Tailwind | tailwindcss@3.4.17 |
| PostCSS | postcss@8 + autoprefixer@10 |
| shadcn CLI | shadcn@2.3.0 |
| React | 18.3.1 |
tailwind-merge | 2.6.0 |
The scaffold owns the v3 theme because the legacy CLI writes v4-flavored variables that do not work with an HSL v3 theme.
Starter demo#
By default the CLI adds a Button component and rewrites src/App.jsx with a small dark/light showcase. Pass --no-sample to skip the component and keep the clean starter screen.
Path aliases#
Imports use the @ alias:
If you add components manually, keep the alias configuration in jsconfig.json, vite.config.js, and components.json in sync.