Back to articles
Tauri Has a Free API: Build Desktop Apps With Web Tech at 1/10th the Size of Electron

Tauri Has a Free API: Build Desktop Apps With Web Tech at 1/10th the Size of Electron

via Dev.to WebdevAlex Spinov

An Electron "Hello World" is 150MB. A Tauri "Hello World" is 3MB. Same web tech frontend. 50x smaller. What Is Tauri? Tauri builds desktop applications using any web frontend (React, Vue, Svelte, vanilla) with a Rust backend. Instead of bundling Chromium (Electron), it uses the OS's native webview. Quick Start npm create tauri-app@latest cd my-app npm install npm run tauri dev You get a native desktop window running your web app. On macOS it uses WebKit, on Windows it uses WebView2, on Linux it uses WebKitGTK. Communicate Between Frontend and Backend // src-tauri/src/main.rs #[tauri::command] fn greet ( name : & str ) -> String { format! ( "Hello, {}! You've been greeted from Rust!" , name ) } fn main () { tauri :: Builder :: default () .invoke_handler ( tauri :: generate_handler! [ greet ]) .run ( tauri :: generate_context! ()) .expect ( "error while running tauri application" ); } // Frontend (any framework) import { invoke } from " @tauri-apps/api/core " const greeting = await invok

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
1 views

Related Articles