create-shadcn-js
v1.0.0
Published
Scaffold a Vite + React + shadcn/ui JavaScript project with zero manual configuration.
Maintainers
Readme
create-shadcn-js
Scaffold a fully configured Vite + React (JavaScript) + Tailwind CSS + shadcn/ui project in seconds — zero manual setup, zero config headaches.
Why create-shadcn-js?
The official shadcn CLI only provides TypeScript templates (--template vite creates .tsx and tsconfig.json). If you build with JavaScript / JSX, setting up Vite with shadcn and Tailwind requires tedious manual work every single time:
- Creating
jsconfig.jsonwithbaseUrland@/*paths so both your editor and the CLI can resolve imports. - Updating
vite.config.jswithpath.resolveand@path alias mapping. - Installing and configuring Tailwind CSS (Tailwind v4 with
@tailwindcss/viteand@import "tailwindcss";inindex.css, or v3 withtailwind.config.jsandpostcss.config.js). - Purging default Vite boilerplate (conflicting
App.cssstyling and SVGs). - Configuring
components.jsonwith"tsx": falseso shadcn generates.jsxandutils.jsfiles rather than TypeScript.
create-shadcn-js takes care of all of this automatically with an interactive CLI powered by @clack/prompts.
Quick Start
Run any of the following in your terminal:
With npx:
npx create-shadcn-js@latestWith npm:
npm create shadcn-js@latestWith pnpm:
pnpm create shadcn-jsWith bun:
bun create shadcn-jsFeatures
- Vite + React (JavaScript): Fast HMR and build speeds using standard
.jsx. - Tailwind CSS v4 & v3: Defaults to the new Tailwind CSS v4 (
@tailwindcss/vite), with support for Tailwind CSS v3. - Seamless shadcn/ui Integration: Directly hands off to the official
shadcn@latest initwizard so you can pick your preferred primitive library (Base UI, Radix UI, or React Aria), presets (Nova, Vega, etc.), and color palettes. - Auto-Configured Path Aliases: Generates
jsconfig.jsonand updatesvite.config.jswith@/*mapping out of the box. - Clean Slate: Automatically removes conflicting default Vite styles and sets up a responsive
index.htmlwith clean typography. - Interactive Showcase Demo: Optionally installs a starter
Buttoncomponent and an interactive dark/light mode demo insrc/App.jsx. - CLI Flags for CI/Automation: Supports non-interactive
-y/--yesmode, preset flags, and custom package managers.
CLI Usage & Options
You can specify the project name directly or pass command-line options:
npx create-shadcn-js [project-name] [options]Options:
| Flag | Description | Default |
| --- | --- | --- |
| [project-name] | Name of the project directory to create | Prompted (my-shadcn-app) |
| --pm <manager> | Package manager to use (npm, pnpm, yarn, bun) | Auto-detected |
| -t, --tailwind <v> | Tailwind version (v4 or v3) | v4 |
| -m, --mode <mode> | Init mode (interactive or quickstart) | interactive |
| -b, --base <base> | Component library (base, radix, aria) | User selection |
| -p, --preset <preset> | Style preset (nova, vega, maia, etc.) | User selection |
| -y, --yes | Skip interactive prompts and use recommended defaults | false |
| -f, --force | Overwrite existing directory without confirmation | false |
| --no-sample | Skip installing sample starter Button component | false |
| --no-git | Skip initializing a Git repository | false |
| -v, --version | Output CLI version | — |
| -h, --help | Display help screen | — |
Examples:
1. Interactive Wizard (Recommended)
npx create-shadcn-js2. Create in a Specific Directory
npx create-shadcn-js my-dashboard3. Quick Non-Interactive Setup (Fast CI / Demo)
npx create-shadcn-js my-app -y4. Custom Preset with pnpm and Tailwind v4
npx create-shadcn-js my-app --pm pnpm --base radix --preset nova -yWhat the Generated Project Looks Like
my-shadcn-app/
├── index.html # Pre-configured viewport and Geist font
├── jsconfig.json # {"paths": {"@/*": ["./src/*"]}}
├── vite.config.js # Vite config with @ alias & Tailwind v4 plugin
├── components.json # Configured with "tsx": false for JavaScript
├── package.json
├── src/
│ ├── components/
│ │ └── ui/
│ │ └── button.jsx # (Optional starter component)
│ ├── lib/
│ │ └── utils.js # cn() helper function
│ ├── App.jsx # Interactive demo with Dark Mode toggle
│ ├── index.css # Clean Tailwind CSS theme variables
│ └── main.jsxAdding More Components
Once your project is created, simply cd into your project and use the official shadcn CLI as usual:
cd my-shadcn-app
npx shadcn@latest add dialog dropdown-menu input card avatar tableComponents will automatically be added as .jsx files inside src/components/ui/!
Contributing
Contributions, issues, and feature requests are welcome!
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
MIT © 2026 create-shadcn-js
