A modern, production-ready template for building cross-platform desktop applications with Tauri, React, TypeScript, and Tailwind CSS. Features a beautiful UI, dark/light theme support, and all the tools you need to get started quickly.
- Beautiful, responsive design with shadcn/ui components
- Dark/Light/System theme support with no flash
- Mobile-first responsive design
- Professional navigation with mobile menu
- Modern hero section and feature showcase
- Lightning fast with Tauri's Rust backend
- Hot reload development experience
- Type-safe communication between frontend and backend
- Small bundle size compared to Electron
- Cross-platform (Windows, macOS, Linux)
- Frontend: React 19, TypeScript, Tailwind CSS
- Backend: Tauri 2.0 (Rust)
- UI Components: shadcn/ui
- Icons: Lucide React
- Routing: React Router
- State Management: React Query
- Build Tool: Vite
- Styling: Tailwind CSS v4
- ESLint & Prettier configuration
- TypeScript strict mode
- Path aliases (
@/forsrc/) - Component library ready
- Production build optimization
Make sure you have the following installed:
- Node.js (v18 or higher)
- Rust (latest stable)
- System dependencies for your platform:
- Windows: Microsoft Visual Studio C++ Build tools
- macOS: Xcode Command Line Tools
- Linux: Various packages (see Tauri docs)
-
Clone the repository
git clone https://github.com/Vishal-770/tauri-react-template.git cd tauri-react-template -
Install dependencies
npm install
-
Start development server
npm run tauri dev
-
Build for production
npm run tauri build
tauri-react-template/
βββ public/ # Static assets
β βββ tauri.svg # App icons
β βββ vite.svg
βββ src/ # Frontend source
β βββ components/ # React components
β β βββ ui/ # shadcn/ui components
β β βββ Layout/ # Layout components
β β βββ Pages/ # Page components
β β βββ NavBar.tsx # Navigation component
β β βββ Footer.tsx # Footer component
β β βββ ModeToggle.tsx # Theme toggle
β β βββ theme-provider.tsx # Theme context
β βββ lib/ # Utility functions
β β βββ utils.ts # Common utilities
β βββ App.tsx # Router setup
β βββ App.css # Global styles & CSS variables
β βββ main.tsx # App entry point
βββ src-tauri/ # Tauri backend
β βββ src/ # Rust source
β β βββ main.rs # Main entry point
β β βββ lib.rs # Library functions
β βββ Cargo.toml # Rust dependencies
β βββ tauri.conf.json # Tauri configuration
β βββ build.rs # Build script
βββ components.json # shadcn/ui config
βββ tailwind.config.js # Tailwind configuration
βββ tsconfig.json # TypeScript config
βββ vite.config.ts # Vite configuration
βββ package.json # Node.js dependencies
- Create a new component in
src/components/Pages/ - Add the route to
src/App.tsx - Update navigation in
src/components/NavBar.tsx
Edit the CSS variables in src/App.css to customize colors:
.light {
--background: oklch(1 0 0);
--foreground: oklch(0.141 0.005 285.823);
--primary: oklch(0.516 0.149 265.725);
/* ... more variables */
}
.dark {
--background: oklch(0.141 0.005 285.823);
--foreground: oklch(0.985 0 0);
--primary: oklch(0.92 0.004 286.32);
/* ... more variables */
}Use shadcn/ui to add more components:
npx shadcn@latest add [component-name]Available components: button, card, input, dropdown-menu, dialog, and many more.
| Command | Description |
|---|---|
npm run tauri dev |
Start development server |
npm run tauri build |
Build for production |
npm run dev |
Start frontend dev server only |
npm run build |
Build frontend only |
npm run preview |
Preview production build |
-
Add Rust function in
src-tauri/src/lib.rs:#[tauri::command] fn my_command(input: String) -> String { format!("Hello, {}!", input) }
-
Register command in
src-tauri/src/main.rs:.invoke_handler(tauri::generate_handler![greet, my_command])
-
Call from frontend:
import { invoke } from '@tauri-apps/api/core'; const result = await invoke('my_command', { input: 'World' });
- Automatic system preference detection
- Persistent theme selection
- No flash of unstyled content (FOUC)
- Smooth transitions between themes
- Mobile-first approach
- Breakpoints: sm (640px), md (768px), lg (1024px), xl (1280px)
- Touch-friendly interface
- Collapsible mobile navigation
- Full TypeScript support
- Type-safe Tauri command invocation
- Strict mode enabled
- Path aliases for clean imports
We welcome contributions! Here's how you can help:
If you find a bug or have a feature request:
- Search existing issues to avoid duplicates
- Create a new issue with:
- Clear description of the problem
- Steps to reproduce
- Expected vs actual behavior
- System information (OS, Node.js version, etc.)
-
Fork the repository
-
Clone your fork
git clone https://github.com/yourusername/tauri-react-template.git
-
Create a feature branch
git checkout -b feature/amazing-feature
-
Make your changes
-
Test thoroughly
-
Commit with conventional commits
git commit -m "feat: add amazing feature" -
Push and create a pull request
We use Conventional Commits:
feat:New featuresfix:Bug fixesdocs:Documentation changesstyle:Code style changesrefactor:Code refactoringtest:Test additions/modificationschore:Build process or auxiliary tool changes
This project is licensed under the MIT License - see the LICENSE file for details.
- Tauri Team for the amazing framework
- React Team for React
- shadcn for the beautiful UI components
- Tailwind CSS for the utility-first CSS framework
- Lucide for the icon library
- π Documentation
- π Issue Tracker
- π¬ Discussions
- π§ Contact
β Star this repo β’ π΄ Fork it β’ π Contribute
Made with β€οΈ by Vishal for the developer community