Desktop Apps (Tauri)
Same web code. Now it lives in the taskbar.
▶ the lesson · narrated sketch video · tap for sound
the intro
Tauri builds desktop apps — and since version two, mobile apps too — from web frontend code with a small Rust backend. Compared to Electron, bundles are megabytes instead of hundreds. System trays, native menus, and file access included.
fun fact ✦
Tauri apps use your OS’s own web renderer — that is why bundles are megabytes, not gigabytes.
the docs
the deep dive
the ideas behind the video — concepts, diagrams, a walkthrough and the traps to avoid
Electron ships a whole Chromium with every app; Tauri borrows the webview your OS already maintains and adds a small Rust core for everything web cannot do — files, processes, tray icons. The frontend stays the HTML, CSS, and JavaScript you already write, and the Rust side is optional muscle. The result: installers measured in megabytes and memory bills to match.
borrow the browser, don't bundle it
key terms
webview
The OS's own browser engine, minus the browser UI. WKWebView on macOS, WebView2 on Windows, WebKitGTK on Linux.
WKWebView on macOScommand
A Rust function marked and registered so the webview can call it like an RPC.
fn greet(name: String)invoke()
The JavaScript side of the bridge — pass typed args as JSON, await the result.
await invoke('greet', { name })capabilities
Tauri 2's permission config: windows get explicit grants for commands and plugins.
grant "fs:allow-read" in confighow it works
- 1Scaffold it
create-tauri-app pairs a template frontend with the src-tauri Rust folder in one command.
- 2Keep your frontend
Vite, Next, Svelte — whatever you already build stays the UI. Tauri just points at its dev server.
- 3Write a command
Mark a Rust function with #[tauri::command] for anything the web cannot reach.
- 4Register and invoke
List it in the handler, call invoke() from JavaScript, pass and receive typed JSON.
- 5Build the installers
tauri build emits .msi, .dmg, and AppImage files — a few megabytes each.
the code, explained
the whole bridge: a Rust function and one call from JavaScript
side by side
Tauri
- bundle: roughly 3-10 MB
- uses the OS webview
- Rust core, tiny memory use
- mobile targets included in v2
Electron
- bundle: 100 MB and up
- ships its own Chromium
- Node core, huge ecosystem
- same rendering on every OS
There is no Chromium in your bundle, so there is no single rendering engine either. Your app runs WebKit on macOS and Linux, which lags Chromium on some newer CSS and JavaScript. Test on all three desktops early, or the Windows demo will sing while the macOS build wheezes.
quick answers
Do I need to know Rust?
For the happy path, barely: copy a command, mark it, call it. Reach for real Rust when you want performance or native libraries.
Why is my invoke denied?
Tauri 2 gates every command through its capability system. Grant the command or plugin to your window in the capabilities config.
Does Tauri do mobile?
Since version two: the same web frontend, with Rust cores compiled for iOS and Android. Desktop-first API surface, with mobile support still maturing.
quick hits about Desktop Apps (Tauri)
short answers · interviews, tips, trivia & hidden gems