A modern, production-ready template for building React applications with TypeScript, Vite, and a comprehensive set of tools and libraries.
- β‘ Vite - Lightning-fast development with Hot Module Replacement (HMR)
- βοΈ React 19 - Latest React with modern hooks and features
- π TypeScript - Type safety and better developer experience
- π¨ Tailwind CSS - Utility-first CSS framework with custom configuration
- π Shadcn/ui - Beautiful, accessible, and customizable UI components
- π TanStack Router - Type-safe routing with file-based routing
- π i18next - Internationalization (English & German included)
- π Dark Mode - Seamless theme switching with next-themes
- β¨ Framer Motion - Smooth animations and transitions
- π¦ Component Library - Pre-built UI components (Buttons, Inputs, Select, Tooltip, Toast, etc.)
- π Lucide Icons - Beautiful, consistent icon set
- π― State Management - Zustand for global state
- π Forms - React Hook Form with Zod validation
- π HTTP Client - Axios pre-configured
- π§ ESLint - Code quality and consistency
- React 19.1.1
- TypeScript 5.9.3
- Vite 7.1.7
- pnpm (package manager)
- Tailwind CSS 4.1.14
- Radix UI (Dropdown, Select, Tooltip)
- shadcn/ui components
- next-themes (dark mode)
- Framer Motion 12.23.22
- Lucide React 0.545.0
- TanStack Router 1.132.47
- Zustand 5.0.8
- React Hook Form 7.64.0
- Zod 4.1.12
- @hookform/resolvers 5.2.2
- i18next 25.5.3
- react-i18next 16.0.0
- i18next-browser-languagedetector 8.2.0
- Axios 1.12.2
- clsx 2.1.1
- tailwind-merge 3.3.1
- class-variance-authority 0.7.1
- Sonner 2.0.7
- Node.js 18+
- pnpm (recommended) or npm/yarn
- Clone or download this template:
git clone https://github.com/73gon/template-react.git
cd template- Install dependencies:
pnpm install- Install the TanStack Router plugin:
pnpm add -D @tanstack/router-plugin- Start the development server:
pnpm dev- Open your browser and navigate to
http://localhost:5173
pnpm dev- Start development serverpnpm build- Build for productionpnpm preview- Preview production buildpnpm lint- Run ESLint
template/
βββ public/ # Static assets
βββ src/
β βββ assets/ # Images, fonts, etc.
β βββ components/ # React components
β β βββ ui/ # Shadcn/ui components
β β βββ darkmode.tsx
β β βββ Home.tsx # Main showcase page
β βββ languages/ # i18n translations
β β βββ en.json
β β βββ de.json
β βββ lib/ # Utility functions
β β βββ i18n.ts # i18n configuration
β β βββ utils.ts # Helper functions
β βββ routes/ # TanStack Router routes
β β βββ __root.tsx
β β βββ index.tsx
β βββ App.tsx # Main app component
β βββ main.tsx # Entry point
β βββ router.ts # Router configuration
β βββ routeTree.gen.ts # Generated route tree
βββ components.json # Shadcn/ui config
βββ package.json
βββ tsconfig.json
βββ vite.config.ts
βββ README.md
This template includes the following pre-built components:
- Button - Multiple variants (default, destructive, outline, secondary, ghost, link) and sizes
- Input - Text inputs with proper styling
- Textarea - Multi-line text input
- Select - Dropdown select with Radix UI
- Tooltip - Hover tooltips
- Toast - Notifications with Sonner
- Dropdown Menu - Context menus and dropdowns
- Dark Mode Toggle - Theme switcher
All components are fully typed, accessible, and customizable.
The template supports multiple languages out of the box:
- English (en)
- German (de)
Add more languages by creating new JSON files in src/languages/ and importing them in src/lib/i18n.ts.
Dark mode is implemented using next-themes and supports:
- Light theme
- Dark theme
- System preference
Toggle between themes using the ModeToggle component.
TanStack Router provides type-safe, file-based routing. Routes are defined in the src/routes/ directory:
__root.tsx- Root layout with router devtoolsindex.tsx- Home page route
Add new routes by creating files in the routes directory. The route tree is automatically generated by the TanStack Router plugin.
Zustand is included for global state management. Create stores in a new src/stores/ directory as needed.
Use React Hook Form with Zod for form handling:
import { useForm } from 'react-hook-form';
import { zodResolver } from '@hookform/resolvers/zod';
import { z } from 'zod';
const schema = z.object({
email: z.string().email(),
});
const { register, handleSubmit } = useForm({
resolver: zodResolver(schema),
});Configure Tailwind in tailwind.config.js or through the @tailwindcss/vite plugin.
Component configuration is in components.json. Add new components with:
npx shadcn@latest add [component-name]ESLint rules are configured in eslint.config.js.
pnpm buildThe build output will be in the dist directory, ready for deployment.
This template can be deployed to any static hosting service:
- Vercel
- Netlify
- GitHub Pages
- Cloudflare Pages
- AWS S3 + CloudFront
Feel free to customize this template for your needs. Some suggestions:
- Add more UI components
- Implement authentication
- Add API integration examples
- Create more routes
- Add unit tests (Vitest recommended)
- Add E2E tests (Playwright/Cypress)
This template is free to use for personal and commercial projects.
Built with amazing open-source projects:
Happy coding! π