This template provides a stater setup to get React working in Vite with TailwindCSS installed.
git clone https://github.com/purnasth/vite-react-tailwind-starter.git
Run the following commands in your terminal:
npm install
npm run dev
npm install
to install the node_modules on your local repo which has been .gitignore in this github repo.npm run dev
for running this in your browser, by default it opens in port http://localhost:5173/
NOTE:
Please disregard these below provided codes if you've already completed the first two steps of the "Getting Started" section. It's only meant for those interested in manually creating a Vite + React project with TailwindCSS.
npm create vite@latest ./
# Select a framework: React
# Select a variant: JavaScript + SWC
npm install
npm run dev
npm install -D tailwindcss 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;
npm install react-icons --save
npm install axios
⭐ Star this repo on GitHub — it helps!