Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# .github
.github
228 changes: 48 additions & 180 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,221 +1,89 @@
# Vite + React + TailwindCSS(4) Starter Kit
# Vite + React 19 + TailwindCSS 4 Starter Kit

---

## Getting Started`*`

### 1. Clone this repo`*`

```sh
git clone https://github.com/purnasth/vite-react-tailwind-starter.git
```

### → for `jsx`

<!-- how to print arrow in markdown ?
https://stackoverflow.com/questions/30003353/how-to-write-an-arrow-in-markdown
-->

```sh
git checkout vrt
```

#### Repo Url: https://github.com/purnasth/vite-react-tailwind-starter-kit/tree/vrt

### &rarr; for `TypeScript`

```sh
git checkout vrt-ts
```

#### Repo Url: https://github.com/purnasth/vite-react-tailwind-starter-kit/tree/vrt-ts

### &rarr; for `react-with-tailwind(v3)`

```sh
git checkout tailwind-v3
```

#### Repo Url: https://github.com/purnasth/vite-react-tailwind-starter-kit/tree/tailwind-v3
This is a modern starter kit for building React 19 applications with Vite and TailwindCSS 4, including TypeScript, Prettier, and best practices for fast, scalable development.

---

### 2. Install and Run`*`

Run the following commands in your terminal:
## ✨ Features

```sh
pnpm install
pnpm run dev
```

- <b><em>`pnpm install`</em></b> to install the node_modules on your local repo which has been .gitignore in this github repo.
- <b><em>`pnpm run dev`</em></b> for running this in your browser, by default it opens in port http://localhost:5173/
- **React 19** (latest)
- **Vite** for lightning-fast development
- **TailwindCSS 4** with custom theming
- **TypeScript** for type safety
- **Prettier** and **prettier-plugin-tailwindcss** for code formatting
- **ESLint** for code quality
- **React Router v7** for routing
- **React Icons** for icon support
- Modern file structure and ready-to-use configuration

---

## Getting Started`*`
## 🛠️ Getting Started

### 1. Clone this repo`*`
Clone the repository:

```sh
git clone https://github.com/purnasth/vite-react-tailwind-starter.git
git clone https://github.com/purnasth/vite-react-tailwind-starter-kit.git
cd vite-react-tailwind-starter-kit
```


### &rarr; for `pnpm TypeScript + Tailwindcss + Prettier (Auto Formatting)`

```sh
the `main` branch
```

#### &rarr; Repo Url: https://github.com/purnasth/vite-react-tailwind-starter-kit/

#

### 2. Install and Run`*`

Run the following commands in your terminal:
Install dependencies:

```sh
pnpm install
pnpm dev
```

- <b><em>`pnpm install`</em></b> to install the node_modules on your local repo which has been .gitignore in this github repo.
- <b><em>`pnpm dev`</em></b> for running this in your browser, by default it opens in port http://localhost:5173/

---


## Codes Used

<b>`NOTE:`
<em>
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 project from scratch with Vite + React, Typescript, TailwindCSS and Prettier (Auto Formatting) with pnpm.
</em>
</b>

### Install vite + react
Start the development server:

```sh
pnpm create vite@latest ./ --template react
# y to proceed
# Select a framework: react
# Select a variant: TypeScript + SWC
pnpm install
pnpm run dev
```

```sh
npm run dev -- --host
```

### Install tailwindCSS

```sh
pnpm install tailwindcss @tailwindcss/vite
```

### Configure the Vite plugin `vite.config.ts`
Update the file `vite.config.ts` file:
```ts
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
import tailwindcss from '@tailwindcss/vite';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), tailwindcss()],
});
```

### Import Tailwind CSS styles `index.css`
Create a file named `index.css` in the `src` directory and add the following lines:
```css
@import "tailwindcss";
```
`NOTE`: In case you are migrating from tailwindcss v3.4 to v4.0, link your existing `tailwind.config.js` file to the new `index.css` file.
The app will be available at [http://localhost:5173](http://localhost:5173).

```css
@config "../tailwind.config.js";
```
---

### Install Prettier
## 📦 Main Libraries Used

```sh
pnpm install -D prettier
```
- `react@19.x`
- `react-dom@19.x`
- `vite@7.x`
- `tailwindcss@4.x`
- `@tailwindcss/vite@4.x`
- `@tailwindcss/postcss@4.x`
- `react-router-dom@7.x`
- `react-icons@5.x`
- `typescript@5.x`
- `prettier@3.x` & `prettier-plugin-tailwindcss@0.6.x`
- `eslint@9.x`

### Add Prettier Config
---

Create a file named `.prettierrc` in the root directory and add the following lines:
## 📝 Usage & Customization

```json
{
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"useTabs": false,
"printWidth": 80,
"endOfLine": "auto"
}
```
- Edit `src/index.css` to customize Tailwind and theme variables.
- Main app entry: `src/App.tsx` (routing setup)
- Home page: `src/pages/Home.tsx`
- Intro component: `src/components/Intro.tsx`
- Update `tailwind.config.js` for custom Tailwind config.
- Use Prettier and ESLint for code quality and formatting.

### Add Prettier Scripts
---

Add the following lines to the `scripts` object in your `package.json` file:
## 🆕 Updating Dependencies

```json
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\"",
"format:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\""
```

### Run Prettier
To keep your project up to date, run:

```sh
pnpm run format
pnpm up --latest
```

### Auto Formatting with Prettier

```sh
pnpm i -D prettier prettier-plugin-tailwindcss
```
---

<b>`NOTE:`
<em>
Enable the `formatOnSave` option in your editor to auto-format your code with Prettier. You can also run the `pnpm run format` command to format your code.
Cheers! Now on every save, your code will be auto-formatted. Congratulations!
</em>
</b>
## 🧑‍💻 Contributing

Feel free to open issues or pull requests for improvements, bug fixes, or new features!

---

## Libraries `pnpm`

```
pnpm install react-router-dom
pnpm install react-icons
```
<!-- pnpm install react-router-dom
pnpm install react-icons
pnpm install react-helmet
pnpm install react-query
pnpm install react-toastify
pnpm install react-modal
pnpm install react-select
pnpm install react-datepicker
pnpm install react-table
pnpm install react-hook-form
pnpm install react-markdown
pnpm install react-syntax-highlighter
pnpm install react-draggable
pnpm install react-beautiful-dnd
pnpm install react-spring
pnpm install react-use
pnpm install react-use-gesture
pnpm install react-use-measure -->

⭐ Star this repo on GitHub — it helps!
## ⭐ Star this repo on GitHub — it helps!
44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@
"preview": "vite preview"
},
"dependencies": {
"@tailwindcss/postcss": "^4.1.4",
"@tailwindcss/vite": "^4.1.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.4.0",
"react-router-dom": "^7.0.2",
"tailwindcss": "^4.1.4"
"@tailwindcss/postcss": "^4.1.11",
"@tailwindcss/vite": "^4.1.11",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-icons": "^5.5.0",
"react-router-dom": "^7.6.3",
"tailwindcss": "^4.1.11"
},
"devDependencies": {
"@eslint/js": "^9.11.1",
"@types/react": "^18.3.10",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react-swc": "^3.5.0",
"autoprefixer": "^10.4.20",
"eslint": "^9.11.1",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.12",
"globals": "^15.9.0",
"postcss": "^8.4.47",
"prettier": "^3.3.3",
"prettier-plugin-tailwindcss": "^0.6.8",
"typescript": "^5.5.3",
"typescript-eslint": "^8.7.0",
"vite": "^5.4.8"
"@eslint/js": "^9.30.1",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
"@vitejs/plugin-react-swc": "^3.10.2",
"autoprefixer": "^10.4.21",
"eslint": "^9.30.1",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
"globals": "^16.3.0",
"postcss": "^8.5.6",
"prettier": "^3.6.2",
"prettier-plugin-tailwindcss": "^0.6.13",
"typescript": "^5.8.3",
"typescript-eslint": "^8.35.1",
"vite": "^7.0.2"
}
}
Loading