explaingit

emilk/egui

📈 Trending29,102RustAudience · developerComplexity · 2/5ActiveLicenseSetup · moderate

TLDR

A Rust library for building graphical interfaces using immediate-mode rendering. Write once, run on desktop (Windows, Mac, Linux, Android) or web via WebAssembly.

Mindmap

mindmap
  root((egui))
    What it does
      Immediate-mode GUI
      Draw each frame
      Handle input same line
    Platforms
      Desktop native
      Web via WebAssembly
      Android support
    Widgets included
      Buttons sliders text
      Color pickers images
      Windows panels menus
    Tech stack
      Rust language
      eframe framework
      WebAssembly support
    Use cases
      Game debug panels
      Tool interfaces
      Data viewers

Things people build with this

USE CASE 1

Add a debug or settings panel to a game engine without leaving Rust.

USE CASE 2

Build a quick desktop tool with a UI that also runs in the browser unchanged.

USE CASE 3

Create a data viewer or visualization app that works on Windows, Mac, Linux, and Android from one codebase.

USE CASE 4

Prototype an interface rapidly without worrying about platform-specific UI frameworks.

Tech stack

RustWebAssemblyeframe

Getting it running

Difficulty · moderate Time to first run · 30min

Requires Rust toolchain installation and potentially wasm-pack for web targets.

Dual-licensed under MIT and Apache 2.0; use freely for any purpose, including commercial, as long as you include the license notice.

In plain English

egui (pronounced "e-gooey") is a library for building graphical user interfaces in the Rust programming language. It works using what is called "immediate mode", instead of setting up a persistent tree of interface elements that react to events, you simply describe what you want to display on every frame, much like drawing to a canvas. This makes it straightforward to reason about: you call a function like "add a button here," and if the button is clicked, you handle it on the same line. The library runs both natively on Windows, Mac, Linux, and Android, and in web browsers via WebAssembly (a technology that lets compiled Rust code run inside a browser). This means the same code can produce either a desktop app or a web app without changes. The companion framework eframe handles the platform-specific setup so you can focus on your interface code. egui includes standard widgets like buttons, sliders, checkboxes, text fields, color pickers, images, collapsible panels, scrollable regions, and moveable windows. It supports anti-aliased rendering (smooth edges on shapes and text), accessibility tools, and multiline text editing with copy/paste. It is particularly well-suited for game developers who want to add a debug or settings panel to a game engine, or for Rust developers who need a quick, self-contained interface for a tool or data viewer. It is not aimed at producing native-looking desktop software, its visual style is its own.

Copy-paste prompts

Prompt 1
Show me how to create a simple button and text field in egui that updates a counter when clicked.
Prompt 2
How do I use egui to build a settings panel for a game, with sliders for volume and checkboxes for options?
Prompt 3
What's the simplest way to compile an egui app to WebAssembly and run it in a browser?
Prompt 4
How do I add a color picker and image display to an egui window?
Prompt 5
Show me an example of a moveable, collapsible panel in egui with multiline text editing.
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.