Quick Start
Add the desktop dependency:Architecture
Wry and Tao
Dioxus Desktop is built on:- Wry: Cross-platform WebView library
- Tao: Cross-platform window creation and management
- Native WebView: Uses the system’s browser engine
- Windows: WebView2 (Chromium)
- macOS: WKWebView (Safari)
- Linux: WebKitGTK
IPC Communication
Desktop apps use Inter-Process Communication (IPC) to bridge Rust and the webview:Configuration
Customize your desktop app withConfig:
Window Configuration
Application Icon
Background Color
Set the window background to prevent flashing:Window Management
Access the window through theuse_window hook:
Multiple Windows
Create additional windows dynamically:Native Menus
Add native menu bars using the muda crate:Handling Menu Events
System Tray
Add a system tray icon:Custom Protocols
Handle custom URL schemes:Async Protocol Handlers
File Dialogs
Global Shortcuts
Register system-wide keyboard shortcuts:JavaScript Evaluation
Execute JavaScript in the webview:Platform-Specific Code
Use conditional compilation for platform-specific features:Packaging and Distribution
Bundle Your App
- Windows:
.exeand optionally.msi - macOS:
.appbundle and.dmg - Linux:
.AppImage,.deb, or.rpm
Code Signing
Configure code signing inDioxus.toml:
Performance Tips
- Minimize IPC: Batch operations to reduce message passing
- Use Native Rendering: Leverage CSS and GPU acceleration
- Optimize Bundle Size: Use
--releaseand strip symbols - Preload Resources: Load assets at startup
Next Steps
- Mobile Platform - Build iOS and Android apps
- Native Platform - GPU-rendered native UI
- Assets - Manage application resources