Egui 0.27 – easy-to-use immediate mode GUI for Rust

Tycho87 | 200 points

This library owns. If you want to impress users with native looks, it's the wrong move. If you want to get shit done, send it!

I am using EGUI for visualizing electron wave functions, configuring and viewing status of UAV flight controllers and peripherals, and as an interface for locating nearby RF devices.

I will say the main negatives are that the `egui`/`eframe` etc split is confusing, and the API rapidly changes in a breaking way. Although part of that is from companion libs like walkers, for maps, that are making their own changes while trying to keep up.

the__alchemist | a month ago

egui author here! Fell free to shoot me any questions. You can try egui in your browser at https://www.egui.rs/

My company Rerun.io is entirely built on egui so that we get the same high-performance UI on the web as on native. Give it a spin at https://app.rerun.io/

emilk | a month ago

I've just started using this to build a better shell for an emulator project! Of all the GUI toolkits I've tried to learn in Rust, egui is just... *delightfully* simple to set up and get started with. No weird lifetimes to wrangle, the context management is sane, and the whole thing is cooperating very nicely with my threaded environment and application-specific event pump. 10/10, do recommend highly.

zeta0134 | a month ago

What's super cool for an open-source GUI framework is that egui integrates with accesskit, an accessibility framework, so it means you can actually make UIs that are accessible when using egui, which is not that common when using non-mainstream UI frameworks.

littlestymaar | a month ago

egui's immediate mode works great with Rust's ownership and borrowing, unlike traditional stateful UI frameworks that can have arbitrary references between widgets and events.

It works very well in games, where it allows creation of complex completely custom UIs, with GPU rendering.

However, egui is an odd choice for desktop applications. It's completely non-native. Even "windows" in egui are custom widgets confined to its canvas, not real OS windows.

pornel | a month ago

Under disadvantages:

> You can also call the layout code twice (once to get the size, once to do the interaction), but that is not only more expensive, it's also complex to implement, and in some cases twice is not enough. egui never does this.

I've found multi-pass imgui to work totally fine, and I use it for one of my apps [1]. I can support (nested) hstack and vstack layouts which IIRC egui can't. There is added expense of calling the "draw" code again, but it's negligible in my profiles (doing the actual layout calculations is more expensive, so I only invalidate the cached layout when the data model changes). It wasn't particularly complex to implement: each ui function simply does different things if you are doing a layout pass vs a draw pass.

[1] https://audulus.com

tayistay | a month ago

I used egui for a personal project and would gladly recommend it. It's simple to use and really responsive. For me it was the first gui library that was a pleasure to work with.

You don't have the native look but for Rust developers that don't have this requirement you should definitely give it a try.

Broussebar | a month ago

Egui is reasonably easy to work with, but the default look and feel... remind me of Windows 3.11 somehow?

It feels dated, and I'm not sure if that's a reflection on me or the toolkit, but it makes me want to reach for something that has better default aesthetics. I'm not even sure if it's possible to fix in Egui or not; if it is, I didn't figure out how in the time I spent on the site.

Filligree | a month ago

I used egui + wasm to whip together a really quick GUI to help me learn to play chords on the guitar, and would do it again in a heartbeat, it's just so easy to reason about, debug, and use.

I wouldn't use it for more serious apps, as I think the immediate mode paradigm makes battery killer websites on laptops and mobile, since unless you are really careful about not making the app re-render, it'll be running your loop at 60fps which isn't great when you leave your site on your phone or laptop.

Edit to plug https://github.com/emilk/eframe_template from the same author: it gets you a rust/wasm webapp hosted in github pages in minutes after cloning + changing a few things, with full CI/CD and everything.

kelvie | a month ago
[deleted]
| a month ago

I've been writing a profiler in egui, and so far have been very happy with it. Comes with the nice bonus that I get both native and web UIs:

https://legion.stanford.edu/prof-viewer/?url=https://sapling...

eslaught | a month ago

I wanted to make a lightweight alternative to Postman and Insomnia so I used this, worked out pretty well I am about to release it to the world after a bit more polishing.

https://github.com/lnenad/Requestor

lnenad | a month ago

Does anyone know a good graph/charting library for Rust that would play well with this?

jakearmitage | a month ago

egui and rerun look and work fantastic, one aspect of immediate mode guis I ran into before was missing layout containers, does egui provide those in some manner?

bfrog | a month ago

I like this project from a technology perspective. However, the biggest consideration for selecting it would be its general a11y.

rapnie | a month ago

I follow the GUI development space out of curiosity. I have made a few GUIs in Java Swing toolkit and I enjoyed it.

When I did GUIs in Android native, I didn't enjoy it at all.

I have loosely played with Qt Quick but I didn't know C++ so I was clueless how to encode user behaviour into a program that implemented the behaviour. My immediate mode Javascript canvas work is far simpler.

LLMs are already generating web GUIs (such as vercel's v0 and others) and we can encode mapping of current state tokens to next behaviour tokens. Hopefully we can specify all the interactions and what should happen due to them.

React vdom refreshes the whole tree changed nodes for recomputation, LLMs could generate the new tree and use an animating library to transform between states - the difference in the trees.

Immediate mode GUIs lend themselves well to this; you just generate/rerender everything.

What I'm interested in is a novel desktop paradigm alternative to windows, mousing and drag and drop.

Intellisense and LSP lets us see the types of what an operation has. But computer GUIs are inherently synchronous unless you're writing a script or program. I would like to click through operations and transform and map from one kind of things to another type of things. This would queue operations up and the computer can schedule them efficiently.

Haskells knows the type of a pipeline at each stage of processing.

I would like to do "algebra with behaviour" and have built in transformations such as joins, swapping, queries and scheduling. If you can map a problem into something you understand based on position, you can do algebraic transformations between states such as binpacking or path finding.

"Break these files into batches, compress+encrypt them, keep them synchronized between these machines and back them up"

samsquire | a month ago