Follow these steps to quickly set up a modern and efficient development environment.
- Introduction
- Prerequisites
- Creating the Project with Vite
- Installing React Router
- Setting Up Tailwind CSS v4
- Installing Icon Libraries
- Project Structure
- Creating Components and Pages
- Setting Up Routes with React Router
- Starting the Development Server
- Conclusion
In this guide, you will learn how to set up a modern web application using Vite 8, React 19, Tailwind CSS v4, React Router v7, Lucide React, and React Icons.
Vite offers a fast and efficient development environment, React makes it easy to build dynamic user interfaces,
Tailwind CSS provides a flexible and efficient way to design styles, and both icon libraries give you thousands of ready-to-use icons.
Before getting started, make sure you have the following installed:
You can verify the installation by running the following commands in your terminal:
node -v
npm -vVite simplifies the configuration of React projects. Below are two options: one for JavaScript projects and another for TypeScript projects.
-
Run the following command to create a new project:
npm create vite@latest project-name
-
During the setup, you will be prompted to select a framework. Choose React.
-
Next, you will be asked to select a variant. Choose JavaScript or TypeScript, depending on your preference.
-
Navigate to your project folder:
cd project-name -
Install the dependencies:
npm install
To enable navigation between pages, install React Router v7:
npm install react-router-domThis will allow you to define and manage routes within your application.
Tailwind CSS v4 uses a PostCSS plugin for integration — no tailwind.config.js required.
-
Install Tailwind CSS and its PostCSS dependencies:
npm install -D tailwindcss @tailwindcss/postcss postcss autoprefixer
-
Create a
postcss.config.jsfile at the root of your project:export default { plugins: { '@tailwindcss/postcss': {}, }, }
-
Replace all content in
src/index.csswith a single import:@import "tailwindcss";
That's it — no config file needed. Tailwind v4 auto-detects your template files automatically.
Lucide React provides a clean, consistent icon set.
npm install lucide-reactimport { Home, Menu, ArrowRight } from 'lucide-react'
<Home size={24} />
<Menu className="w-6 h-6 text-blue-500" />
<ArrowRight size={18} />React Icons includes icons from Font Awesome, Material Design, Heroicons, and many more.
npm install react-iconsimport { FaGithub, FaReact } from 'react-icons/fa'
import { MdHome, MdInfo } from 'react-icons/md'
<FaGithub size={24} />
<MdHome className="text-blue-500" />project-name/
├── src/
│ ├── components/
│ │ └── Navbar.tsx (or Navbar.jsx)
│ ├── pages/
│ │ ├── Home.tsx (or Home.jsx)
│ │ └── About.tsx (or About.jsx)
│ ├── App.tsx (or App.jsx)
│ ├── main.tsx (or main.jsx)
│ └── index.css
├── index.html
├── package.json
├── postcss.config.js
└── vite.config.ts (or vite.config.js)
Example Home.tsx (Page):
import { Link } from "react-router-dom";
import { ArrowRight, Info } from "lucide-react";
const Home = () => {
return (
<>
<title>Welcome to my Page</title>
<meta name="description" content="A shift to something with more potential." />
<div className="min-h-screen flex flex-col items-center justify-center bg-gray-100 text-center">
<h1 className="text-5xl font-bold text-blue-600">Welcome to My Page</h1>
<p className="mt-4 text-lg text-gray-700">
Still Working Here.
</p>
<div className="mt-6 flex space-x-4">
<Link
to="/about"
className="flex items-center gap-2 px-6 py-3 bg-blue-500 text-white rounded-lg shadow-md hover:bg-blue-600 transition"
>
Learn More <ArrowRight size={18} />
</Link>
<Link
to="/contact"
className="flex items-center gap-2 px-6 py-3 bg-gray-500 text-white rounded-lg shadow-md hover:bg-gray-600 transition"
>
<Info size={18} /> Info
</Link>
</div>
</div>
</>
);
};
export default Home;Example Navbar.tsx (Component):
import { Link } from "react-router-dom";
import { Home, Info, BookOpen } from "lucide-react";
const Navbar = () => (
<nav className="bg-white shadow-md p-4">
<ul className="flex space-x-6 items-center">
<li>
<Link to="/" className="flex items-center gap-1 hover:text-blue-600 transition">
<Home size={18} /> Home
</Link>
</li>
<li>
<Link to="/about" className="flex items-center gap-1 hover:text-blue-600 transition">
<Info size={18} /> About
</Link>
</li>
<li>
<Link to="/docs" className="flex items-center gap-1 hover:text-blue-600 transition">
<BookOpen size={18} /> Docs
</Link>
</li>
</ul>
</nav>
);
export default Navbar;import { BrowserRouter as Router, Routes, Route } from "react-router-dom";
import Navbar from "./components/Navbar";
import Home from "./pages/Home";
const App = () => (
<Router>
<Navbar />
<Routes>
<Route path="/" element={<Home />} />
</Routes>
</Router>
);
export default App;npm run devAccess http://localhost:5173.
Now you have a fully configured application with Vite 8, React 19, Tailwind CSS v4, React Router v7, Lucide React, and React Icons, featuring functional routing, modern icons, and a modular structure ready to scale.
This guide was designed to streamline web development. Created by PixlGalaxy.