# egui

> An easy-to-use immediate mode GUI library for Rust that runs on both web (via WebAssembly) and native platforms.

egui (pronounced "e-gooey") is a simple, fast, and highly portable immediate mode GUI library written in pure Rust. Created and maintained by Emil Ernerfeldt ([@emilk](https://github.com/emilk)) and sponsored by Rerun, it targets both native desktop platforms and the web via WebAssembly, making it one of the few Rust GUI libraries that works seamlessly across both environments.

## What It Is

egui is an **immediate mode GUI library** — meaning the UI is described and rendered every frame rather than stored as a persistent object tree. Unlike retained-mode frameworks, egui requires no callbacks, no on-click handlers, and no synchronization between app state and GUI state. A button interaction looks like: `if ui.button("Save file").clicked() { save(file); }`. The library is not a framework; it is a library you call into, giving you full control over the application loop.

The official application framework built on top of egui is `eframe`, which supports compiling the same app to Web, Linux, macOS, Windows, and Android.

## Immediate Mode: Tradeoffs to Know

The immediate mode model has concrete advantages and disadvantages the README documents explicitly:

**Advantages:**
- No callbacks or event handlers cluttering code flow
- No risk of stale GUI state diverging from app state
- GUI code can live in a simple function — no dedicated UI object required
- Highly interactive UIs can be more performant than retained-mode equivalents

**Disadvantages:**
- Layout is harder: window sizes must be known before content is laid out, causing occasional first-frame jitter (mitigated via `Context::request_discard` for a second pass)
- Large scroll areas with many widgets can tax the CPU since layout runs every frame
- Typical CPU cost is 1–2 ms per frame; egui only repaints on interaction or animation

## Widget and Feature Set

egui ships with a broad set of built-in widgets and layout primitives:

- **Widgets**: labels, text buttons, hyperlinks, checkboxes, radio buttons, sliders, draggable values, text editing, color pickers, spinners, images
- **Layouts**: horizontal, vertical, columns, automatic wrapping
- **Text editing**: multiline, copy/paste, undo, emoji support
- **Windows**: movable, resizable, named, minimizable, auto-sized and auto-positioned
- **Regions**: resizing, vertical scrolling, collapsing headers, panels
- **Rendering**: anti-aliased lines, circles, text, and convex polygons via the `epaint` 2D graphics API
- **Accessibility**: optional integration with [AccessKit](https://accesskit.dev/), enabled by default in `eframe`, providing native accessibility APIs on Windows and macOS

A community-maintained wiki lists additional third-party egui crates for extended widgets and features.

## Integration Architecture

egui is designed to be renderer-agnostic — it produces a triangle mesh each frame that any graphics backend can render. Official integrations include:

- **`eframe`** — cross-platform app framework (web + native)
- **`egui_glow`** — rendering via the `glow` OpenGL wrapper
- **`egui-wgpu`** — rendering via the WebGPU API (`wgpu`)
- **`egui-winit`** — windowing integration via `winit`

Third-party integrations cover game engines including Bevy (`bevy_egui`), `miniquad`, `three-d`, and others. The integration surface is intentionally minimal: gather input, call GUI code, handle output, render triangles.

## Update: Version 0.36.1

The latest release is **0.36.1**, published on August 7, 2026, described as a `Sense::drag()` bugfix release. The repository remains under active development with the `main` branch last pushed August 25, 2026. The project has accumulated over 30,000 GitHub stars and more than 2,100 forks, reflecting broad community adoption. egui is dual-licensed under MIT and Apache 2.0.

## Features
- Immediate mode GUI — no callbacks or retained widget state
- Runs on web (WebAssembly) and native (Windows, macOS, Linux, Android)
- Built-in widgets: buttons, sliders, text editing, color picker, images, and more
- Horizontal, vertical, column, and auto-wrapping layouts
- Anti-aliased 2D rendering via epaint
- Accessibility support via AccessKit (Windows and macOS)
- Custom widget authoring
- Dark and light themes with full style customization
- Multiline text editing with copy/paste, undo, and emoji support
- Movable and resizable windows with auto-sizing
- Vertical scrolling regions and collapsing headers
- Renderer-agnostic triangle mesh output
- Official eframe framework for cross-platform apps
- wgpu and glow rendering backends
- winit windowing integration
- No unsafe code in egui core
- Minimal default dependencies
- Wasm-friendly codebase throughout

## Integrations
eframe (official cross-platform framework), egui_glow (OpenGL via glow), egui-wgpu (WebGPU via wgpu), egui-winit (windowing via winit), bevy_egui (Bevy game engine), egui-miniquad (miniquad), three-d, AccessKit (accessibility), egui_extras (image loading), rfd (file dialogs, native and Wasm)

## Platforms
WINDOWS, MACOS, LINUX, ANDROID, WEB, API, DEVELOPER_SDK

## Pricing
Open Source

## Version
0.36.1

## Links
- Website: https://www.egui.rs/
- Documentation: https://docs.rs/egui
- Repository: https://github.com/emilk/egui
- EveryDev.ai: https://www.everydev.ai/tools/egui
