A starter project using Vite, React, TypeScript, Tailwind CSS, and shadcn/ui components.
- Vite – Fast build tool
- React – UI library
- TypeScript – Type safety
- Tailwind CSS – Utility-first styling
- shadcn/ui – Re-usable UI components
npm create vite@latest my-app
# Select: React + TypeScript
cd my-app
npm installnpm install -D tailwindcss@3 postcss autoprefixer
npx tailwindcss init -p/** @type {import('tailwindcss').Config} */
export default {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}
@tailwind base;
@tailwind components;
@tailwind utilities;
npx shadcn@latest init
- Style: New York (Recommended)
- Base color: Neutral
This generates:
- components.json
- Updates Tailwind config
- Adds src/lib/utils.ts
Example: add a button
npx shadcn@latest add button
This creates: src/components/ui/button.tsx
In src/App.tsx:
import { Button } from "@/components/ui/button"
function App() {
return (
<div className="flex items-center justify-center min-h-screen bg-background">
<Button>Click Me</Button>
</div>
)
}
export default App
npm run dev
my-app/
├── src/
│ ├── components/
│ │ └── ui/
│ │ └── button.tsx
│ ├── lib/
│ │ └── utils.ts
│ ├── App.tsx
│ ├── main.tsx
│ └── index.css
├── tailwind.config.js
├── postcss.config.js
├── tsconfig.json
└── components.json
Add more shadcn components:
npx shadcn@latest add card input dialog
- Customize theme in tailwind.config.js
- Build your app 🎉
Made with ❤️ by Tanmay Shil GitHub: @TanmayShil