GUI guide

Windows GUI in Rust — egui, WinUI, iced & Slint guide 2026

For Windows GUI in Rust you have two main paths: native Win32/WinUI via the windows crate (maximum platform integration), or cross-platform stacks like egui, iced or Slint (faster development, same code on Windows, Linux and macOS).

Rust GUI frameworks for Windows — comparison

FrameworkApproachLearning curveBest for
windows-rs + WinUI 3Native Win32/WinRTSteepWindows-only apps, full platform integration
eguiImmediate mode, cross-platformLowTools, dev dashboards, quick UIs
icedElm architecture, cross-platformMediumDesktop apps, functional style
SlintDeclarative DSL, cross-platformMediumCommercial apps, embedded + desktop
winit + wgpuRaw window + GPUHighGames, custom rendering

Build a desktop app with egui on Windows

Cargo.toml
[dependencies]
eframe = "0.27"
egui = "0.27"
src/main.rs
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!");
}
});
})
}

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:

Cargo.toml
[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.

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.