egui (pronounced "e-gooey") is an immediate mode GUI library written in pure Rust. It targets developers who need a simple, portable way to add a graphical interface to a Rust application, whether that's a standalone desktop/web app or a debug overlay inside a game engine. Because it's immediate mode, there's no widget tree to manage, no callbacks, and no risk of GUI state drifting out of sync with app state.
egui doesn't assume anything about your platform or renderer. It just produces a mesh of textured triangles each frame, which means it can be wired into almost any rendering setup. The official eframe framework wraps this up for you, letting the same codebase compile to web (via Wasm), Linux, Mac, Windows, and Android.
if ui.button("Save").clicked() { save(file); }.unsafe, and keeps its default dependency footprint small.egui-wgpu, egui_glow, egui-winit) handle input, painting, and output.epaint 2D graphics API) independently and combine them as needed.egui fits well when you're already writing something in Rust and need a functional GUI without a lot of ceremony: debug tools, editors, small utility apps, or a settings/inspector panel bolted onto a game engine. It's also a reasonable choice if you want to ship the same app to both a browser and a desktop binary without maintaining two UI codebases. Projects like the Rerun Viewer show it can support production-quality tools, not just prototypes.
It's not the right fit if you're not writing Rust, or if you need a UI that looks and behaves like a native OS widget set, since egui renders its own look rather than deferring to platform styling. It's also a weaker choice if API stability matters a lot right now; the project is under active development and breaking changes ship with new releases. Very large scrollable UIs with long scrollback content can also be slower, since layout happens every frame, though egui only repaints on interaction or animation so idle apps use no extra CPU.
For a quick native or web app, start from the official template instead of setting up integrations by hand:
git clone https://github.com/emilk/eframe_template/
Then follow the instructions in that repo to build and run it.
To add egui directly to an existing Rust project, add it as a dependency in Cargo.toml:
[dependencies]
egui = "*"
eframe = "*"
To load images, add the official extras crate:
egui_extras = "*"
If you want to try the web demo locally, run:
cargo run --release -p egui_demo_app
The native backend uses wgpu via the egui-wgpu crate and works out of the box on Mac and Windows. On Linux, install these dependencies first:
sudo apt-get install -y libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev
On Fedora Rawhide:
dnf install clang clang-devel clang-tools-extra libxkbcommon-devel pkg-config openssl-devel libxcb-devel gtk3-devel atk fontconfig-devel
These system packages are only needed for running the demo app; egui itself is platform agnostic and has no such requirements.