Complete Setup Guide: From Installation Chaos to Netlify Deployment Success
Updated for June 2025++ | Perfect for Frontend Developers & Beginners
When Tailwind CSS 4.0 launched on January 22, 2025, it completely changed installation processes, leaving developers worldwide struggling with broken setups and confusing error messages.
Visual representation of how React, Vite, and Tailwind CSS 4.0 work together
Follow these tested steps for a perfect installation
Node.js must be installed on your PC. Download from: nodejs.org
Recommended version: Node.js 18+ or latest LTS
Visual Studio Code IDE recommended. Download from: code.visualstudio.com
These commands work perfectly in VS Code's integrated terminal
node --version
npm --version
You should see version numbers for both Node.js and npm.
Template: react
npm create vite@latest {projectName} -- --template react
Replace {projectName} with your desired project name.
cd {projectName}
Libraries: tailwindcss, @tailwindcss/vite
npm install tailwindcss @tailwindcss/vite
Path: vite.config.ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
// https://vite.dev/config/
export default defineConfig({
plugins: [
tailwindcss(),
react()
],
})
Important: The tailwindcss() plugin must be placed before the react() plugin.
Path: src\index.css
@import "tailwindcss";
This replaces all default CSS content with Tailwind's import.
import React from 'react'
function App() {
return (
<div className="min-h-screen bg-blue-500 flex items-center justify-center">
<div className="text-center">
<h1 className="text-4xl font-bold text-white mb-4">
🎉 Tailwind CSS 4.0 is Working!
</h1>
<p className="text-blue-100 text-lg mb-6">
Your React + Vite setup is complete
</p>
<button className="bg-white text-blue-500 px-6 py-3 rounded-lg font-semibold hover:bg-blue-50 transition-colors">
Get Started
</button>
</div>
</div>
)
}
export default App
min-h-screen
: Full viewport height
bg-blue-500
: Blue background color
flex items-center justify-center
: Centers content perfectly
text-4xl font-bold
: Large, bold text
hover:bg-blue-50
: Color changes on hover
transition-colors
: Smooth color animation
npm run dev
This is what you should see when your React app is running successfully with Tailwind CSS 4.0!
npm run build
What this does:
npm run build
dist/
folder to Netlify Drop
That's it! Your React + Vite + Tailwind CSS 4.0 app is now hosted on Netlify.
Vite + React:
https://coruscating-cobbler-1a329c.netlify.app/See it in action! This is an example of the deployed React + Vite + Tailwind CSS 4.0 setup running live on Netlify.