If you're starting with Tailwind CSS v4, you might’ve noticed:
most tutorials and videos are still stuck in the old version. I faced it too—docs didn’t help much, and outdated commands like tailwindcss inithad me completely lost.

So here’s the step-by-step setup that finally worked for me:

Tailwind v4 Setup with React + Vite

  1. Create your Vite + React project:
    npm create vite@latest my-app -- --template react
    cd my-app

  2. Install Tailwind CSS v4 with Vite plugin:
    npm install -D tailwindcss@latest @tailwindcss/vite

  3. Create and edit src/index.css:
    @import "tailwindcss";

  4. Update vite.config.js:

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'

export default defineConfig({
  plugins: [react(), tailwindcss()],
});
  1. Make sure main.jsx imports ./index.css

  2. Test it in App.jsx:

function App() {
  return (
    
      Hello Tailwind v4!
    
  );
}
  1. Run your dev server: npm run dev

✅ And you’re all set with Tailwind v4 running in your React app using Vite!

😅 Want to Hear the Chaos Behind This?
If you’re curious about how I actually figured this out—confusion, outdated guides, broken commands, Discord help, and even ChatGPT misfires—I wrote a separate blog post on my full struggle story in Medium.

👉 Read: 💻 My Tailwind CSS v4 Setup Struggle

Hope it helps another beginner avoid the same mess I went through! 💙