Alex Spinov Electron apps ship a 150MB Chromium browser. Tauri 2 uses the OS native webview — your app is 5-10MB...
Electron apps ship a 150MB Chromium browser. Tauri 2 uses the OS native webview — your app is 5-10MB and uses 10x less RAM.
| Electron | Tauri 2 | |
|---|---|---|
| App size | 150-300MB | 3-10MB |
| RAM usage | 200-500MB | 20-50MB |
| Backend | Node.js | Rust |
| Frontend | Chromium | OS WebView |
| Platforms | Desktop only | Desktop + Mobile |
| Startup time | 2-5 seconds | 0.5-1 second |
| Auto-update | Yes | Yes |
| System tray | Yes | Yes |
| Security | Limited | Capability-based |
npm create tauri-app@latest
# Choose: React, Vue, Svelte, Solid, Vanilla, Angular
# Choose: TypeScript or JavaScript
cd my-app && npm install && npm run tauri dev
// src-tauri/src/lib.rs
#[tauri::command]
fn greet(name: &str) -> String {
format!("Hello, {}! You have been greeted from Rust!", name)
}
#[tauri::command]
async fn read_file(path: String) -> Result<String, String> {
std::fs::read_to_string(&path).map_err(|e| e.to_string())
}
pub fn run() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![greet, read_file])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
// Frontend (any framework)
import { invoke } from "@tauri-apps/api/core";
const greeting = await invoke<string>("greet", { name: "World" });
const fileContent = await invoke<string>("read_file", { path: "/tmp/data.txt" });
npm install @tauri-apps/plugin-fs
npm install @tauri-apps/plugin-dialog
npm install @tauri-apps/plugin-shell
npm install @tauri-apps/plugin-notification
npm install @tauri-apps/plugin-http
npm install @tauri-apps/plugin-store
import { readTextFile, writeTextFile } from "@tauri-apps/plugin-fs";
import { open, save } from "@tauri-apps/plugin-dialog";
// File picker dialog
const filePath = await open({ filters: [{ name: "Text", extensions: ["txt", "md"] }] });
const content = await readTextFile(filePath);
// Save dialog
const savePath = await save({ defaultPath: "output.txt" });
await writeTextFile(savePath, "Hello!");
# Add mobile targets
npm run tauri android init
npm run tauri ios init
# Run on simulator
npm run tauri android dev
npm run tauri ios dev
# Build for release
npm run tauri android build
npm run tauri ios build
Same frontend code runs on desktop AND mobile.
// src-tauri/capabilities/default.json
{
"identifier": "default",
"windows": ["main"],
"permissions": [
"core:default",
"fs:allow-read-text-file",
"dialog:allow-open",
"shell:allow-open"
]
}
Each window gets only the permissions it needs. No blanket access.
Need desktop or mobile app development? I build cross-platform tools and data solutions. Email spinov001@gmail.com or check my Apify tools.