egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native

★ 32,184⑂ 2,356
RustCreated 2019-01-13www.egui.rs/
32,184
stars
+228+256+1,329
2,356
forks
–
watchers
–
prs
–
issues
–
releases
–
discussions

README

🖌 egui: an easy-to-use GUI in pure Rust

















👉 Click to run the web demo 👈


egui (pronounced "e-gooey") is a simple, fast, and highly portable immediate mode GUI library for Rust. egui runs on the web, natively, and in your favorite game engine.

egui aims to be the easiest-to-use Rust GUI library, and the simplest way to make a web app in Rust.

egui can be used anywhere you can draw textured triangles, which means you can easily integrate it into your game engine of choice.

eframe is the official egui framework, which supports writing apps for Web, Linux, Mac, Windows, and Android.


 Example

 rust
ui.heading("My egui Application");
ui.horizontal(|ui| {
    ui.label("Your name: ");
    ui.text_edit_singleline(&mut name);
});
ui.add(egui::Slider::new(&mut age, 0..=120).text("age"));
if ui.button("Increment").clicked() {
    age += 1;
}
ui.label(format!("Hello '{name}', age {age}"));
ui.image(egui::include_image!("ferris.png"));


     

 Sections:

 Example
 Quick start
 Demo
 Goals
 State / features
 Dependencies
 Who is egui for?
 Integrations
 Why immediate mode
 FAQ
 Other
 Credits

(中文 README / Chinese README)


 Quick start

There are simple examples in the examples/ folder. If you want to write a web app, then go to  and follow the instructions. The official docs are at . For inspiration and more examples, check out the egui web demo and follow the links in it to its source code.

If you want to integrate egui into an existing engine, go to the Integrations section.

If you have questions, use GitHub Discussions. There is also an egui discord server. If you want to contribute to egui, please read the Contributing Guidelines.

 Demo

Click to run egui web demo (works in any browser with Wasm and WebGL support). Uses eframe.

To test the demo app locally, run cargo run --release -p egui_demo_app.

The native backend is egui-wgpu (using wgpu) and should work out-of-the-box on Mac and Windows, but on Linux you need to first run:

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 you need to run:

dnf install clang clang-devel clang-tools-extra libxkbcommon-devel pkg-config openssl-devel libxcb-devel gtk3-devel atk fontconfig-devel

NOTE: This is just for the demo app - egui itself is completely platform agnostic!

 Goals

 The easiest to use GUI library
 Responsive: target 60 Hz in debug build
 Friendly: difficult to make mistakes, and shouldn't panic
 Portable: the same code works on the web and as a native app
 Easy to integrate into any environment
 A simple 2D graphics API for custom painting (epaint).
 Pure immediate mode: no callbacks
 Extensible: easy to write your own widgets for egui
 Modular: You should be able to use small parts of egui and combine them in new ways
 Safe: there is no unsafe code in egui
 Minimal dependencies

egui is not a framework. egui is a library you call into, not an environment you 

Snapshot: 2026-11-10T09:35:25Z · Data license Apache-2.0 · JSON