⚡️ Electron + Vite + React + TypeScript + Tailwind CSS + shadcn/ui
A minimal Electron starter template with shadcn/ui pre-configured. Add UI components just like web projects.
- ⚡️ Electron Vite - Fast HMR for Electron apps
- 🎨 shadcn/ui - Pre-configured and ready to use
- 📘 TypeScript - Full type safety
- 🌈 Tailwind CSS 4 - Modern styling
- ⚛️ React 19 - Latest React
# Clone the repo
git clone https://github.com/yourusername/electron-vite-shadcn-starter
cd electron-vite-shadcn-starter
# Install dependencies
pnpm install
# Start development
pnpm devWorks exactly like web projects:
# Add any component
npx shadcn@latest add button
npx shadcn@latest add dialog
npx shadcn@latest add card
# Use it in your code
import { Button } from "@/components/ui/button"├── src/
│ ├── main/ # Electron main process
│ ├── preload/ # Preload scripts
│ └── renderer/src/ # React app (shadcn/ui components here)
│ ├── components/
│ ├── lib/
│ └── App.tsx
├── electron.vite.config.ts
├── vite.config.ts # For shadcn CLI
└── components.json # shadcn/ui config
# Build for macOS
pnpm build:mac
# Build for Windows
pnpm build:win
# Build for Linux
pnpm build:linuxThis template solves the shadcn/ui + Electron integration:
- Dual config setup:
electron.vite.config.tsfor Electron,vite.config.tsfor shadcn CLI - Correct paths: All imports use
@/pointing tosrc/renderer/src/ - TypeScript configured: Both
tsconfig.jsonandtsconfig.web.jsonsetup - Tailwind CSS 4: Using
@import "tailwindcss"syntax
pnpm dev # Start dev server
pnpm build # Build the app
pnpm build:mac # Build for macOS
pnpm build:win # Build for Windows
pnpm build:linux # Build for Linux
pnpm lint # Lint code
pnpm format # Format code- Electron - Desktop app framework
- Vite - Build tool
- React - UI library
- TypeScript - Type safety
- Tailwind CSS - Styling
- shadcn/ui - UI components
MIT