This template provides a minimal setup to get React working in Vite with HMR, TypeScript, and shadcn/ui components. It's designed to give a quick start for building modern React applications with a beautiful UI out of the box.
- React 18
- Vite for fast development and building
- TypeScript for type safety
- shadcn/ui components for a sleek UI
- Tailwind CSS for styling
- Dark mode support
- Biome for linting and formatting
- Lefthook for Git hooks
- TanStack Router for routing
-
Clone this repository
-
Install dependencies:
pnpm install
-
Start the development server:
pnpm dev
pnpm dev
: Start the development serverpnpm build
: Build for productionpnpm preview
: Preview the production buildpnpm fix
: Run Biome to check and fix issuespnpm fix:all
: Run Biome on all filespnpm type-check
: Run TypeScript type checking
src/
: Source filescomponents/
: React componentsui/
: shadcn/ui componentslayout/
: Layout componentsdark-mode/
: Dark mode components
lib/
: Utility functionsroutes/
: TanStack Router route componentsmain.tsx
: Application entry point
public/
: Static assetsindex.html
: HTML entry point
vite.config.ts
: Vite configurationtailwind.config.js
: Tailwind CSS configurationtsconfig.json
: TypeScript configurationbiome.json
: Biome configurationlefthook.yml
: Lefthook configurationcomponents.json
: shadcn/ui configuration
This template is set up with a basic structure and some example components. The src/routes/index.lazy.tsx
file contains a basic kitchen sink of components.
The project uses Biome for linting and formatting. You can expand the configuration in the biome.json
file. Then expand as needed based on https://biomejs.dev/
This template uses TanStack Router for routing. You can find route definitions in the src/routes/
directory.
Dark mode support is included out of the box. You can toggle between light and dark mode using the ModeToggle
component in the header.
This template uses Tailwind CSS for styling. The main CSS file is located at src/index.css
, which includes the base Tailwind directives and custom CSS variables for theming.
shadcn/ui components are located in the src/components/ui/
directory. You can customize these components or add new ones as needed.
This template includes Lefthook for Git hooks. The pre-commit hook runs Biome checks and type checking before allowing commits. You can customize the Git hooks in the lefthook.yml
file.
This project is licensed under the MIT License. See the LICENSE file for details.