A modern, production-ready template for building beautiful desktop applications with cutting-edge web technologies and a complete UI component library.
This template combines the latest versions of powerful technologies:
All shadcn-svelte components are pre-installed and ready to use:
Clone this template:
git clone https://github.com/your-username/wails2-svelte5-tailwind4-ts-vite.git
cd wails2-svelte5-tailwind4-ts-vite
Install dependencies:
# Frontend dependencies are installed automatically by Wails
wails dev
To run in live development mode:
wails dev
This will:
For frontend-only development:
cd frontend
npm run dev
To build a production-ready distributable package:
wails build
Import and use components in your Svelte files:
<script lang="ts">
import { Button } from "$lib/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "$lib/components/ui/card";
import { Input } from "$lib/components/ui/input";
import { Label } from "$lib/components/ui/label";
</script>
<Card class="w-96">
<CardHeader>
<CardTitle>Login</CardTitle>
</CardHeader>
<CardContent class="space-y-4">
<div class="space-y-2">
<Label for="email">Email</Label>
<Input id="email" type="email" placeholder="Enter your email" />
</div>
<Button class="w-full">Sign In</Button>
</CardContent>
</Card>
Dark mode is automatically configured. Toggle between themes:
<script lang="ts">
import { toggleMode } from "mode-watcher";
</script>
<Button on:click={toggleMode}>Toggle Theme</Button>
āāā frontend/ # Svelte frontend application
ā āāā src/
ā ā āāā lib/
ā ā ā āāā components/
ā ā ā ā āāā ui/ # shadcn-svelte components
ā ā ā āāā utils.ts # Utility functions
ā ā ā āāā hooks/ # Custom Svelte hooks
ā ā āāā App.svelte # Main application component
ā ā āāā main.ts # Application entry point
ā ā āāā style.css # Global styles with Tailwind
ā āāā components.json # shadcn-svelte configuration
ā āāā package.json # Frontend dependencies
ā āāā tsconfig.json # TypeScript configuration
ā āāā vite.config.ts # Vite configuration
āāā app.go # Go application context
āāā main.go # Go application entry point
āāā wails.json # Wails configuration
āāā build/ # Build assets and configuration
This template uses Tailwind CSS 4 with the new CSS-first configuration approach. All theme variables are defined in frontend/src/style.css
:
Components are configured in frontend/components.json
and installed in frontend/src/lib/components/ui/
. Each component is:
The following path aliases are configured:
$lib
ā frontend/src/lib
$lib/components
ā frontend/src/lib/components
$lib/components/ui
ā frontend/src/lib/components/ui
$lib/utils
ā frontend/src/lib/utils
$lib/hooks
ā frontend/src/lib/hooks
To add additional shadcn-svelte components:
cd frontend
npx shadcn-svelte@latest add [component-name]
For example:
npx shadcn-svelte@latest add calendar
npx shadcn-svelte@latest add date-picker
This template provides a solid foundation that's easy to extend:
frontend/src/style.css
for global styles@layer
directivefrontend/src/lib/components/
wails.json
http://localhost:34115
This template supports modern browsers with:
For broader compatibility, configure Vite's build target in frontend/vite.config.ts
.
This template is available under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.
If you find this template helpful, please consider: