Oct 10, 2024
npm create vite@latest test-project
cd test-project
npm install
npm run dev
App.jsx
and replace it with:
<div>
<h1>Simple Application</h1>
</div>
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
tailwind.config.js
:
content: [
"index.html",
"src/**/*.{js,jsx,ts,tsx}"
],
index.css
:
@tailwind base;
@tailwind components;
@tailwind utilities;
app.css
file if no longer needed.npm run dev
<div className="text-gray-500">Hello Tailwind</div>
npm install react-router-dom
createBrowserRouter
from React Router DOM:
const router = createBrowserRouter([
{ path: "/", element: <Layout />, children: [
{ path: "", element: <HomePage /> },
{ path: "about", element: <AboutPage /> },
// Add more routes here
] }
]);
pages
folder and add your components (e.g., AboutPage, ServicesPage).RouterProvider
and pass in the router setup.Link
for navigation between pages.<Link to="/">Home</Link>
git init
git add .
git commit -m "Initial commit"