Uses Vite as the development server and build tool, paired with React and TypeScript
React-Vite-Tanstack-Starter-Template — Vite Starter Template
By whereissam
A Vite and React starter template integrating TanStack Router/Query, TailwindCSS v4, and shadcn/ui (Base UI primitives), with built-in testing, code quality, and AI collaboration configuration.
Explore the design
Compare the page layouts and mobile experience. Open any screenshot for a closer look.
Actual screenshot captured by the server browser.
All pages & views 2
Screenshots show visual appearance; interactive behavior may differ.
What stands out
A quick read of the recorded project description.
Integrates TanStack Router file-based routing and TanStack Query data fetching
Adopts TailwindCSS v4 and shadcn/ui (Base UI primitives), providing button, card, and input by default
Includes a built-in unit testing environment with Vitest and Testing Library
Configures ESLint, Prettier, lefthook pre-commit hooks, GitHub Actions CI, and Dependabot
Contains configuration files for AI coding tools such as AGENTS.md, llms.txt, and .mcp.json
Template Details
This is a starter template for React projects, using Vite as the build tool, React as the UI framework, and TypeScript for type safety. Routing is managed file-based by TanStack Router, while data fetching and caching are handled by TanStack Query. The styling layer uses TailwindCSS v4, integrated via a Vite plugin; components come from shadcn/ui, built on Base UI primitives, and the template includes button, card, and input by default.
The template also preconfigures a unit testing environment with Vitest and Testing Library, code linting and formatting with ESLint and Prettier, pre-commit hooks with lefthook and lint-staged, as well as GitHub Actions CI and Dependabot dependency updates. The repository includes files such as AGENTS.md, CLAUDE.md, llms.txt, .cursor/rules, and .mcp.json for use with AI coding tools.
Before use, note the following: the template requires Bun 1.0+, or Node.js 20.19+/22.12+ as the toolchain environment; shadcn/ui components are based on Base UI, which differs in API from the Radix version (for example, using a render prop instead of asChild). The demo site and screenshots are for display only, and licenses for third-party assets must be checked separately.
Is it right for your project?
Use Cases
- When you need to quickly scaffold a React + Vite + TypeScript project skeleton
- When you want to use TanStack Router file-based routing and TanStack Query for routing and data fetching
- When you plan to build the interface with TailwindCSS v4 and shadcn/ui (Base UI)
- When you need unit testing, linting, formatting, and CI processes in place from the start
- When you want to develop with AI coding tools and need corresponding convention files
Suitable For
- Frontend developers familiar with React, TypeScript, and Vite
- Projects that need type-safe routing and data fetching solutions
- Interface development scenarios using shadcn/ui and TailwindCSS v4
- Teams or individuals who value code quality toolchains and automated processes
Getting started & customization
Use these recorded setup notes alongside the repository instructions for your chosen version.
- 1
Requires Bun 1.0+, or Node.js 20.19+/22.12+ as the toolchain environment
- 2
You can create a new repository via GitHub's Use this template button, or clone the repository directly
- 3
Install dependencies with bun install, start the dev server with bun run dev, default address is http://localhost:5173
- 4
When adding shadcn/ui components, pass --base base to install the Base UI version
- 5
When migrating from Radix, note that Base UI uses a render prop instead of asChild
License & source material
Usage conditions & limitations
Free to use · keep license noticeThis entry covers the free version under the MIT license in the public repository; the free scope applies to that version's code and does not imply that external services or third-party assets are free.
Must comply with when using
- You are allowed to use, modify, commercialize, and distribute this version's code for free.
- When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
- The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.
Additional costs & items to verify
- Using this template requires installing Bun 1.0+, or using Node.js 20.19+/22.12+ as the toolchain environment; otherwise, installation and development commands cannot run.
- When adding components via the shadcn CLI, you must pass the --base base parameter; otherwise, the Radix version will be installed instead of the Base UI version the template is based on.
- Components are based on Base UI, which has a different API from Radix: you need to use a render prop instead of asChild to change the underlying element, and migrating from Radix requires rewriting related code.
- Demo images, fonts, icons, and other third-party assets must be checked against their respective licenses and cannot be judged solely by the code's MIT license.
- External services such as domains, hosting, databases, payments, or AI may incur additional charges.
View Original Text Basis
Permission is hereby granted, free of charge
Original License Text
**Prerequisites:** [Bun](https://bun.sh) 1.0+ (Node.js 20.19+ / 22.12+ also works for the toolchain).
Original README
pass `--base base` so it installs the Base UI versions
Original README
https://github.com/whereissam/React-Vite-Tanstack-Starter-Template/blob/main/LICENSEhttps://github.com/whereissam/React-Vite-Tanstack-Starter-Template/blob/main/README.mdBase UI replaces the `asChild` prop with a `render` prop.
Original README
Compiled by DeepSeek based on repository license and README ·2026-10-02. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.
Project checks & description sources
Template Information
- Source platforms
- GitHub
- Documentation and maintenance reference score
- More documented · 88 / 100
- Technologies
- Vite · React
- Website type
- Starter
How this score is calculated
Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.
What to verify for this project
- Repository update recorded
- 2026-10-02
- Screenshot last checked
- 2026-10-02
A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.
The catalog identifies Vite as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.
Use a selection guide →How this description was prepared
AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.
Automatically checked against source and license rules; no manual editorial review.
Inspect the recorded source material
SHA-256: 3642af0e11ce82676ab826ae005efaa1c93c595a9a81cb605ebf95ce37110c0c
2026-10-02T11:36:23.950Z
Source file / repository<div align="center">
# React · Vite · TanStack Starter
A modern, type-safe React starter template — **Vite**, **TanStack Router & Query**, **TailwindCSS v4**, and **shadcn/ui** on **Base UI** primitives.
[](https://github.com/whereissam/React-Vite-Tanstack-Starter-Template/actions/workflows/ci.yml)
[](#license)




</div>
---
## Features
- **Vite 8** — lightning-fast dev server and build
- **React 19** — the latest React with modern features
- **TypeScript** — strict, end-to-end type safety
- **TailwindCSS v4** — utility-first styling via the new Vite plugin
- **shadcn/ui** — beautiful, accessible components on **Base UI** primitives
- **TanStack Router** — type-safe, file-based routing
- **TanStack Query** — data fetching, caching, and server state
- **Vitest** — unit testing with Testing Library
- **ESLint + Prettier** — linting and formatting (Tailwind class sorting) out of the box
- **AI-agent ready** — `AGENTS.md`, `llms.txt`, and `.mcp.json` so AI tools work productively in this repo
- **Pre-commit hooks** — lefthook + lint-staged auto-fix staged files
- **CI + Dependabot** — GitHub Actions (lint, typecheck, format, test, build) and weekly dependency updates
## Quick Start
> Click **["Use this template"](https://github.com/whereissam/React-Vite-Tanstack-Starter-Template/generate)** on GitHub to start a new repo from this starter.
```bash
# 1. Clone (or use the template button above)
git clone https://github.com/whereissam/React-Vite-Tanstack-Starter-Template.git
cd React-Vite-Tanstack-Starter-Template
# 2. Install dependencies
bun install
# 3. Start the dev server
bun run dev
```
Then open **[http://localhost:5173](http://localhost:5173)**.
> **Prerequisites:** [Bun](https://bun.sh) 1.0+ (Node.js 20.19+ / 22.12+ also works for the toolchain).
## Scripts
| Command | Description |
| ---------------------- | --------------------------------------------------- |
| `bun run dev` | Start the development server |
| `bun run build` | Type-check and build for production |
| `bun run preview` | Preview the production build |
| `bun run lint` | Run ESLint |
| `bun run typecheck` | Type-check only (`tsc --noEmit`) |
| `bun run format` | Format all files with Prettier |
| `bun run format:check` | Check formatting without writing |
| `bun run check` | Lint + typecheck + format check |
| `bun run verify` | Full gate: check + test + build (run before "done") |
| `bun run test` | Run the test suite once |
| `bun run test:watch` | Run tests in watch mode |
## Components
This template ships with `button`, `card`, and `input` from **shadcn/ui**, built on **Base UI** primitives. Add more with the CLI — pass `--base base` so it installs the Base UI versions:
```bash
bunx shadcn@latest add dialog --base base
bunx shadcn@latest add dropdown-menu --base base
```
> **Migrating from Radix?** Base UI replaces the `asChild` prop with a `render` prop.
> To change a component's underlying element, pass an element to `render`:
>
> ```tsx
> // Radix: <Button asChild><a href="/">Home</a></Button>
> // Base UI: <Button render={<a href="/" />}>Home</Button>
> ```
## Project Structure
```
src/
├── components/
│ ├── ui/ # shadcn/ui components (Base UI primitives)
│ └── ... # app-level components (nav, theme, etc.)
├── lib/
│ └── utils.ts # cn() and other helpers
├── routes/ # TanStack Router file-based routes
│ ├── __root.tsx # Root layout route
│ └── index.tsx # Home route (/)
├── test/
│ └── setup.ts # Vitest + Testing Library setup
├── main.tsx # App entry
└── index.css # Tailwind + design tokens
```
## Tech Stack
| Layer | Tools |
| -------------- | ------------------------------------------------------------ |
| **Framework** | React 19, TypeScript |
| **Build** | Vite 8 |
| **Routing** | TanStack Router (file-based) |
| **Data** | TanStack Query |
| **Styling** | TailwindCSS v4, `class-variance-authority`, `tailwind-merge` |
| **Components** | shadcn/ui on Base UI, Lucide icons |
| **Testing** | Vitest, Testing Library |
| **Quality** | ESLint, Prettier, lefthook, GitHub Actions CI, Dependabot |
## Routing
Routing is file-based via TanStack Router — add a file in `src/routes/` and the route tree is generated automatically:
| File | Route |
| --------------------------- | ------------- |
| `src/routes/index.tsx` | `/` |
| `src/routes/about.tsx` | `/about` |
| `src/routes/blog/index.tsx` | `/blog` |
| `src/routes/blog/$slug.tsx` | `/blog/:slug` |
## Styling
TailwindCSS v4 is wired through the Vite plugin and a semantic design-token system (see [`docs/design-system.md`](./docs/design-system.md)). It supports:
- CSS-variable design tokens with light/dark mode
- Component variants with `class-variance-authority`
- Class merging with `tailwind-merge`
## Testing
Unit tests run on **Vitest** with **Testing Library** in a jsdom environment. Tests live next to the code they cover (e.g. `src/components/ui/button.test.tsx`):
```bash
bun run test # run once
bun run test:watch # watch mode
```
## AI-Agent Ready
This template is built to be productive with AI coding tools out of the box:
| File | Purpose |
| ---------------- | ----------------------------------------------------------------- |
| `AGENTS.md` | Canonical conventions read by Cursor, Copilot, Codex, and others |
| `CLAUDE.md` | Pointer to `AGENTS.md` for Claude Code |
| `llms.txt` | Concise project map in the [llms.txt](https://llmstxt.org) format |
| `.cursor/rules/` | Cursor rule that defers to `AGENTS.md` |
| `.mcp.json` | MCP servers (ships with Playwright for UI verification) |
Guardrails keep AI-generated changes honest: ESLint + Prettier, a **lefthook**
pre-commit hook that auto-fixes staged files, a `bun run verify` gate (lint +
typecheck + format + test + build), and **Dependabot** for weekly dependency
updates.
## License
Released under the **MIT License** — free to use for personal and commercial projects.
Explore similar templates
Compare previews and descriptions within the same stack and category.

react-starter-kit
A full-stack SaaS monorepo starter built on Vite and React, with Bun, TypeScript, tRPC, Drizzle ORM, Better Auth, Stripe, and Cloudflare Workers. It includes email OTP, passkey, Google OAuth, organizations, subscription billing, Drizzle migrations, seed scripts, and Terraform infrastructure.
Vite · SaaS

cove
Cove is a minimal TanStack Start starter template maintained by mugnavo, integrating React, TanStack Router/Query, Tailwind CSS, shadcn/ui, Drizzle ORM with PostgreSQL, Better Auth, Vite Plus, and Nitro.
Vite · SaaS

vite-react-boilerplate
A production-ready Vite + React starter template with TypeScript, Tailwind CSS, TanStack Router/Query/Table, Storybook, React Hook Form + Zod, Vitest and Playwright testing, plus Husky/Commitizen/Commitlint commit conventions.
Vite · Starter

react-vite-admin
A backend management starter built on Vite and React, integrating Recoil, React Query, TypeScript, and Axios, with Ant Design-style interface screenshots. Suitable as a starting point for management-side projects, licensed under MIT, with Chinese documentation and common scripts.
Vite · Admin dashboard

typescript-react_best_practices-vite_template
A Vite + React + TypeScript starter template by CodelyTV, preconfigured with Jest and React Testing Library unit tests, Cypress end-to-end tests, ESLint and Prettier using Codely's shared configuration, GitHub Actions workflows, a Makefile, and Sass.
Vite · Starter

cloudflare-starter-kit
A Cloudflare Workers project scaffolding template maintained by kriasoft, using Vite and TypeScript, with three built-in workspaces: api, app, and edge, and preconfigured local testing, multiple environments, and a GitHub Actions deployment workflow.
Vite · Starter
