Seven Rust GUI Libraries, Two Questions: Who Draws and What Changes When Data Moves
I recently wanted to develop a tool for Android source code development. The features are not complex, just miscellaneous: verifying signatures, getting device signatures, checking device permissions, etc.
Although the command line can handle these problems, the operations are not intuitive and are troublesome to explain to test colleagues.
So I planned to develop a desktop application that runs on Windows and Linux.
I compared familiar desktop frameworks like CMP (Compose Multiplatform), Flutter, and also researched several Rust GUI frameworks. In the end, I chose Rust, for a simple reason: I value speed the most!
I don't need a rich set of ready-made themes and UI widgets; I only need a simple, fast, and extensible GUI library. For this small tool, I find CMP too large. It can bundle the required Java runtime with it, so colleagues don't need to install JVM separately, but I still want to save that bulk.
Then a very simple question arises: which Rust GUI library should I use?
I spent half a day researching and roughly found these: GPUI, Tauri, Egui, Iced, Slint, Dioxus, Xilem.
Each has a dedicated user base, and each has a considerable presence on forums!
When you open their example code, you find they don't even look like the same kind of program.
That is what confused me most.
After some simple sorting, I think the reason is actually clear: these libraries make different choices about how the interface should work. Clarify these choices, and choosing a library becomes much easier.
I'll use a simple log viewer app as an example.
Keeping the UI and data in sync
Every GUI library can draw a button and tell you when it is clicked. That part isn't hard.
The hard part is making the UI follow data changes. When you type "payment" in the search box, the list has to show only log entries containing "payment". Somewhere has to handle this change: when the search text changes, update the list.
Each library handles this change differently, and the traditional way tends to conflict with Rust.
The traditional tool conflict with Rust
Traditional toolkits like GTK maintain a widget tree in memory. The window holds a panel, the panel holds a search box and a list. As long as the window is open, these widgets exist.
You connect them through callbacks. Callbacks are small functions the library calls when something happens. For example: "every time the search text changes, execute this function to update the list."
In the end, parts reference each other in a web. The parent widget holds child widgets, child widgets need access to the parent, and several callbacks may all want to modify the same filter text.
Android developers should be familiar with this; it's much like the old way of building UI mainly with View.
Now think about Rust's core rule: every value has exactly one owner. Other code can borrow it, but at any time either multiple read-only borrows or one mutable borrow exist. The compiler checks these rules before the program runs, eliminating a whole class of errors.
If you directly connect widgets with crossed references, you easily hit this rule: the panel still borrows the list, the search box's callback wants to modify it; the same filter text has multiple places trying to modify it. When borrows conflict, the compiler won't let it pass. The widget tree itself doesn't violate ownership rules; the trouble is the organization of shared mutable state.
There are ways around it. For example, Rust's RefCell<T> can defer borrow checking from compile time to runtime.
The code does run, but it's too verbose to write.
If a previous borrow hasn't ended and you make a conflicting mutable borrow through borrow_mut(), it panics; using try_borrow_mut() lets you get the error and handle it.
So most developers of Rust GUI libraries avoid this traditional structure. Each team has found a design that fits Rust's ownership rules. That's why there are so many libraries.
Distinguishing these libraries with two questions
To tell them apart, ask two questions.
First question: Who draws the pixels?
- Some libraries delegate to the WebView. They use the browser engine on the modern OS to display a web page made of HTML and JavaScript in a desktop window.
- Others draw every pixel themselves, usually delegating to the graphics card, like a video game, drawing full frames many times per second.
Second question: What happens when data changes?
- Immediate mode: instead of carrying over the previous frame's UI description, the entire interface is re-described frame by frame. This sounds wasteful, but it's simple, because the UI is always just a presentation of the current data.
- Retained mode: each widget persists, and only the changed parts are updated. The list gets new rows, while the search box stays put. Traditional toolkits do this.
- Between the two: after each change, the code builds a lightweight UI "plan". The library compares it to the previous plan and updates the changed parts. Compose also updates the UI based on state changes, but it relies on state read tracking and recomposition, not simply comparing two complete UI trees.
With these two questions in mind, let's look at the main options.
Egui: the simplest answer
Egui, created by Emil Ernerfeldt, uses immediate mode. The whole UI is a function that runs every time the UI needs to be drawn. You write ordinary code from top to bottom, one line per widget.
For example: if the "Clear Filter" button is clicked, clear the filter.
This single line does two things: draws the button and tells you whether it was clicked. No need to register a callback or store a button object.
All data lives in a struct you own: open files, search text, selected log level. Egui reads the data when drawing and releases borrows when done. The owner is clear, and Rust's rules stop being a problem.
For desktop apps, pair it with its official companion framework Eframe. Eframe handles opening the window, and by default draws the UI through WGPU, which handles talking to the graphics card; alternatively, a Glow backend based on OpenGL is available. The same code can also be compiled to WebAssembly and run in the browser.
"Won't it burn battery by redrawing all the time?" That's a fair question. Eframe only repaints when something happens, like mouse movement, key presses, or when you explicitly request a repaint. When idle, the overhead is minimal.
Is it good for a log viewer?
In fact, it's sufficient!
You can build a first version in an afternoon: a search box, a log-level dropdown, and a scrollable list that only constructs visible rows. Development is fast, so Egui is popular for internal tools, debug panels, and game editors.
Rerun, which Ernerfeldt co-founded, uses Egui for its data viewer, showing it can also work in real products.
Where it's less comfortable:
- Widgets are usually laid out in sequence, so measuring a group of widgets first and then deciding positions is less direct than a system that separates measurement from layout. Center alignment, fitting column widths to content, and similar needs sometimes require extra handling. However, Egui already supports multiple rounds of immediate-mode layout, so you can measure first and then re-run layout.
- The default look resembles developer tools. Fine for internal use, but not enough for a product with your own brand.
- As the app grows, such as adding tabs, settings, and background loading threads, the code that modifies data gets scattered across draw functions.
If that scattering starts to bother you, check out the next library.
Iced: concentrating every change in one place
Iced, initiated by Héctor Ramón, borrows from the Elm language design. Elm is known for being easy to understand. An Iced app has four parts:
- State: a struct holding all app state, like open files, search text, and selected log level.
- Message: an enum listing all possible events, like search text changed, log level selected, file load completed.
- Update: receives one message at a time, and is the only place responsible for changing state.
- View: reads state and returns a UI description; it does not modify state.
For example, when you type the letter "P" in the search box, here's what happens:
- The search box doesn't directly modify data; it generates a message: "Search text changed to P."
- Iced hands the message to
update, which stores the new text. - Iced calls
view, which describes a list showing only matching rows.
Every change in the app follows the same flow. It fits Rust's rules nicely: view is read-only, update is the only writer. Debugging is easier because every change is a message that can be logged and replayed.
This resembles Compose's recommended unidirectional data flow: state flows down, events flow up.
Time-consuming work like reading a huge log file can be wired into async flow via tasks to avoid freezing the window; blocking file reads still need to go on a background thread, not just wrapped in an async task and expected not to block. When the task completes, it sends a message, so update handles the result the same way it handles a click event.
For drawing, Iced uses WGPU; if no usable GPU is available on the machine, it can fall back to tiny-skia, which renders via CPU. Its largest real-world user is System76: its COSMIC desktop is built on libcosmic, which in turn is built on Iced. So panels, settings apps, and file managers are all Iced programs underneath.
So what's the cost?
- You have to write more code. Even a small UI needs to define a message for each user action, and the more features, the larger
updatebecomes. - Iced isn't at 1.0 yet, and past major versions often required changes to existing code to adapt.
- The official guide is still being written, so a good part of learning comes from reading example programs.
One thing developers might not like: although the source is still updated, as of November 2026, the most recent formal release, 0.14.0, is from December 7, 2025, almost a year ago.
Tauri: handing drawing to the web
Both Egui and Iced draw the UI themselves, so every widget, text box, and chart has to be implemented in Rust. If your team already builds web interfaces, or the charts you need only exist as JavaScript libraries, throwing away that investment is a shame.
Tauri answers the drawing question differently: let the OS WebView draw the UI.
On Windows it uses WebView2, based on Edge; on macOS it uses WKWebView, which uses Safari's engine; on Linux it's WebKitGTK.
A Tauri app splits into two parts:
- The frontend the user sees: a web page. You can use React, Svelte, Vue, or plain HTML.
- The backend: a Rust program that does the real work, like opening files and searching.
You may have heard of Electron, which VS Code and Slack use. It also puts a web page in a desktop window. The difference: every Electron app bundles a full Chromium, while Tauri uses the computer's engine. As a result, Tauri installers are often only a few MB, while Electron can reach 100 MB or more, depending on the app itself.
The frontend and backend communicate through commands.
A command is an ordinary Rust function marked with Tauri-specific attributes. In our log viewer, it could be a search function that takes search text and returns matching rows. The web page calls invoke, passing the command name and search text. These calls typically serialize arguments and results as JSON, Tauri runs the corresponding Rust code, and returns the result to the web page.
This split suits a log viewer well: Rust scans large files, and the web page only receives the small number of logs it needs. If logs are being written continuously and need live updates, Tauri also provides channels that stream data to the web page in sequence.
Tauri 2 has been stable since October 2024, adding the ability to support iOS and Android in the same project. It also introduced capabilities, which restrict which core and plugin commands a window or WebView can use, and scope access for commands that support it. When configured correctly, you can limit malicious web code from calling things like file access. However, custom commands registered via invoke_handler are, by default, callable by all windows and WebViews in the app, and need additional configuration to be included in permission restrictions.
Trade-offs:
- Different OSes use different web engines, so visuals and behavior may vary slightly across Windows, macOS, and Linux. On Linux you also need to watch WebKitGTK compatibility.
- With regular JSON calls, data between the web page and Rust needs to be serialized and parsed. If you pass 2 million lines of logs at once, these costs can become a bottleneck. Tauri also supports raw binary requests and responses, so not all communication has to be text. For huge logs, you should still paginate results and use a virtual list on the web side, creating only visible rows.
GPUI: writing a library because browsers aren't fast enough
GPUI comes from the Zed editor team.
Zed is one of the more notable Rust-based editors these days.
The founders, including Nathan Sobo, previously worked on GitHub's Atom editor. Atom was based on Electron; in fact, Electron was originally created for Atom. After years of trying to speed up Atom, they concluded that an editor built on a browser engine is ultimately limited by that engine.
Great minds think alike. I also care about the trade-offs in JVM-based apps regarding startup, memory, and garbage collection, and I also believe JVM-based apps are ultimately limited by the JVM.
So when building Zed, they wrote their own GUI library, designed more like a video game than a web page. The goal is up to 120 frames per second, giving each frame just over 8 milliseconds of preparation time. Drawing goes straight to the graphics card: Metal on macOS, DirectX 11 on Windows; per the materials I referenced, WGPU on Linux.
So how does its data flow work?
It combines two ideas:
- Data lives in entities, held centrally by a single object called the app context. Your code doesn't hold data directly; it holds a handle, like a ticket, to access the entity through the app context. This preserves a single owner. Each entity can also notify the outside when it has changed, so the UI knows it needs updating.
- A view is an entity that knows how to draw itself. Each frame, the library has the main view generate a new element tree, containing rows, buttons, text blocks, etc., described with chained calls like
div().flex().gap(...). Web developers should be familiar with this Tailwind-like style. A layout library named Taffy computes each box's size and position.
For a log viewer, the most critical feature is the uniform list.
If every row is the same height, the list only needs to measure one row to figure out positions of the others, and draw only the part that fits on screen. By only laying out and drawing visible rows, scrolling through 2 million log lines can cost nearly as much as browsing 50 lines. The cost of reading, indexing, and filtering the whole file still has to be counted separately.
The problem:
GPUI serves Zed first, and other users come second. Its API changes with Zed's needs, and there's sparse documentation; often you have to read Zed's source directly. Screen-reader support is still catching up to traditional toolkits.
A company called Longbridge maintains gpui-kit, offering 70+ ready-made widgets, which helps a lot.
In my view, GPUI is well suited for tools that care about drawing speed, but it's still changing rapidly, and you'll have to follow another team's roadmap. As for whether it's the fastest of these, that needs to be measured in the same scenarios.
Others
- Slint: uses its own small language, a bit like simpler HTML, which compiles to efficient Rust code. It's especially good on memory-constrained devices, like coffee-machine screens and car dashboards. On its website, Slint markets itself mainly for embedded UI.
- Dioxus: like React in Rust. You build UI from reusable components, then render to a WebView or its own experimental renderer.
- Xilem: a research project from the Linebender team, aiming for a reactive design that naturally fits Rust's rules.
- GTK-rs and Relm4: GTK-rs provides Rust bindings for GTK, and Relm4 builds an Elm-inspired application architecture on top of it. This traditional toolkit underpins a large portion of Linux desktop apps.
One thing worth noting: these projects share many low-level components.
Many libraries use Winit for windows, WGPU for drawing, Taffy for layout, and AccessKit to describe widgets to screen readers. When one shared library improves, it can benefit several GUI libraries at once.
What to choose for a log viewer
Based on the comparison above, here's how I'd choose:
- For your own team, deliver tomorrow: choose Egui. Immediate mode keeps code short and direct.
- It'll grow into a full app with many pages and multi-person collaboration: choose Iced. The message mechanism gives every change a clear handling spot; the more code, the more valuable this becomes.
- Team already writes web UI, or you need mobile support: choose Tauri. Existing web skills keep working, and heavy search work goes to Rust.
- You really value scrolling through millions of log lines, and you can accept API churn: choose GPUI. It's built for exactly this.
These libraries don't have a single ranking from good to bad. They simply give different answers to the same two questions: who draws the pixels, and how does the UI follow data changes? Answer these two questions for your own project first, and which library to pick becomes largely clear.
And me
As for my tool for Android source development, I ended up picking GPUI. Because for me, speed is the most important metric!
Top 1 from juejin.cn, machine-translated. The original thread is authoritative.
makePad development speed is also quite fast.