Desktop GUI Applications
Desktop graphical user interface (GUI) applications in Rust use either a system webview or a native GPU renderer. Select a framework that matches your platform targets, licensing terms, and accessibility requirements.
Framework selection
Compare the main production frameworks before you create the repository.
| Framework | Architecture | Best fit | Notes |
|---|---|---|---|
| Tauri v2 | Rust backend with system webview frontend | Consumer desktop and mobile applications | Small binaries, web UI ecosystem, strict IPC permissions. |
| Iced | Pure-Rust retained mode (Elm architecture) on wgpu |
Native cross-platform desktop applications | Type-safe message loop. Powers System76 COSMIC. |
egui (eframe) |
Pure-Rust immediate mode on wgpu or glow |
Developer tools, debuggers, and internal dashboards | Fast to write. Limited custom layout and accessibility. |
| Slint | Declarative .slint UI language compiled to Rust |
Commercial desktop and embedded interfaces | Clear split between UI and logic. Dual GPLv3 and commercial license. |
| GPUI | Pure-Rust GPU-accelerated retained and immediate hybrid | High-frame-rate editors and power-user tools | Built for Zed. Smaller general widget ecosystem. |
Check the license of each framework and its transitive dependencies with
cargo-deny. Refer to Supply chain security.
Architecture and thread safety
Never block the UI thread with disk I/O, network requests, or heavy computation. A blocked UI thread freezes window redraws and causes the operating system to mark the application as unresponsive.
- Keep domain state and business logic in a separate library crate that does not depend on GUI types.
- Start background tasks on a
tokioruntime or worker thread pool. - Send results back to the UI thread through typed messages, commands, or async channels.
- Store user configuration and data in operating system standard directories with
directoriesinstead of hardcoded paths.
Security controls
Desktop applications operate with the privileges of the local user. Apply least privilege to every boundary.
Tauri v2 capabilities and CSP
In Tauri v2, define granular capability files in src-tauri/capabilities/. Grant
each window only the commands and plugin permissions that it needs.
{ "$schema": "../gen/schemas/desktop-schema.json", "identifier": "default", "description": "Permissions for the main window", "windows": ["main"], "permissions": [ "core:default" ]}Set a strict Content Security Policy (CSP) in tauri.conf.json to block
cross-site scripting (XSS) in the webview. Do not expose arbitrary filesystem or
shell commands to the frontend. Validate every IPC command argument in Rust.
Secrets and updates
- Store tokens and credentials in the operating system keychain, not in plain-text configuration files.
- Sign auto-update packages with an offline signing key and check signatures
before installation. In Tauri v2, use
tauri-plugin-updaterwith a pinned public key. - Use pure-Rust TLS (
rustls) configured with a platform certificate verifier (such asrustls-platform-verifier) or an explicit enterprise CA bundle, or use OS-native TLS stores.rustlswith bundled public roots alone does not trust enterprise proxy CAs installed only in the operating system store.
Accessibility
Support keyboard navigation, high-contrast themes, and screen readers from the start of the project.
- Webview frameworks such as Tauri inherit browser accessibility trees when the frontend uses semantic HTML and ARIA attributes.
- Native Rust toolkits such as
egui,Slint, and customwinitapplications integrate with AccessKit. AccessKit maps Rust UI trees to UI Automation on Windows, NSAccessibility on macOS, and AT-SPI on Linux. - Test keyboard focus order and screen reader announcements on each target operating system.
Testing GUI applications
Split tests into fast headless tests and focused UI tests.
- Do tests of all business logic, state transitions, and persistence in the core
library crate with
cargo nextest run --locked. Refer to Testing strategy. - For Elm-architecture frameworks such as Iced, write unit tests that send
Messagevalues to theupdatefunction and assert on the new state. - For Tauri applications, check IPC commands with
tauri::test::mock_appand check the frontend with Playwright or WebDriver. - Start platform builds in CI on Linux, macOS, and Windows runners to detect platform-specific linker or system-library errors early. Refer to CI/CD pipeline.
Packaging, code signing, and notarization
Operating systems warn users or block unsigned desktop binaries. Automate packaging and signing in your release workflow.
| Platform | Package formats | Signing requirement |
|---|---|---|
| macOS | .app, .dmg |
Sign with a Developer ID Application certificate (codesign) and notarize with Apple (notarytool). |
| Windows | .msi, NSIS .exe |
Sign with an Authenticode code-signing certificate (EV or cloud HSM such as Azure Trusted Signing). |
| Linux | .deb, .rpm, AppImage, Flatpak |
Sign package repositories or publish GPG signatures and SHA-256 checksums. |
Store signing certificates and Apple API keys in protected CI secrets with environment approval gates. Publish checksums, SBOMs, and provenance attestations for every installer. Refer to Release automation.