GUI options
Rust GUI frameworks for Windows — comparison
| Framework | Approach | Learning curve | Best for |
|---|---|---|---|
| windows-rs + WinUI 3 | Native Win32/WinRT | Steep | Windows-only apps, full platform integration |
| egui | Immediate mode, cross-platform | Low | Tools, dev dashboards, quick UIs |
| iced | Elm architecture, cross-platform | Medium | Desktop apps, functional style |
| Slint | Declarative DSL, cross-platform | Medium | Commercial apps, embedded + desktop |
| winit + wgpu | Raw window + GPU | High | Games, custom rendering |
egui quickstart
Build a desktop app with egui on Windows
[dependencies]
eframe = "0.27"
egui = "0.27"
fn main() -> eframe::Result {
eframe::run_simple_native("My App", Default::default(), |ctx, _| {
egui::CentralPanel::default().show(ctx, |ui| {
ui.heading("Hello from egui on Windows!");
if ui.button("Click me").clicked() {
println!("clicked!");
}
});
})
}
Native WinUI
WinUI 3 with Rust via windows-rs
WinUI 3 is Microsoft's modern native UI framework. Use it from Rust via the windows crate with WinRT types:
[dependencies]
windows = { version = "0.57", features = [
"UI_Xaml",
"UI_Xaml_Controls",
"Win32_System_WinRT",
] }
WinUI via windows-rs is verbose and requires understanding of WinRT's async model. For most new projects, egui or Slint are faster to ship. Use WinUI only when deep Windows integration (Fluent design, system themes, notifications) is required.
FAQ
GUI questions
What is the best GUI framework for Rust on Windows in 2026?
For most projects: egui (via eframe) is the fastest to get started and produces good-looking cross-platform apps. For production desktop apps with a polished UI, Slint offers a declarative DSL and commercial licensing. For Windows-only apps that need Fluent design and full platform integration, use windows-rs with WinUI 3.
Can Rust make Windows GUI apps without unsafe code?
Yes. egui, iced and Slint are largely safe Rust. They handle the unsafe Windows API calls internally. The windows crate for direct Win32 access requires unsafe blocks at the call site because Win32 APIs predate Rust's safety model.