Skip to main content

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.json has "tsx": false and "rsc": false.
  • shadcn components are generated as .jsx files.
  • The cn() helper lives in src/lib/utils.js; any utils.ts is removed.
  • jsconfig.json provides baseUrl and @/* paths for editors.
  • vite.config.js resolves @ 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)#

PieceValue
Tailwindtailwindcss@4
Vite integration@tailwindcss/vite@4
shadcn CLIshadcn@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)#

PieceValue
Tailwindtailwindcss@3.4.17
PostCSSpostcss@8 + autoprefixer@10
shadcn CLIshadcn@2.3.0
React18.3.1
tailwind-merge2.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.