DEV Community

Ian Pride
Ian Pride

Posted on • Updated on

Advice for building a cross-platform RUST gui

TDLR; - What Rust desktop gui crate/framework do you use or recommend for use in Windows and Linux?

Need some advice on what some of you Rustaceans prefer to use to build desktop guis; especially cross-platform for Windows and Linux. I'll build it for Mac if there isn't much extra effort involved.

I've done my own research, but I'm just asking the community for your preferences/experiences. It's looking like Druid will be my first try unless I get some better advice, although I'll eventually try everything.

I recently re-wrote the CLI version of one of my programs (3rd iteration; 1st was AutoHotkey in Windows and 2nd is cross-platform in Python) in Rust and now I'd like to build the gui version for it. Not really much to the gui except for 2 i32 inputs, displayed text, and possible a copy to clipboard feature.

Top comments (6)

Collapse
 
jrop profile image
Jonathan Apodaca

I've heard that gtk-rs is really nice (and that the GNOME project itself is supporting Rust bindings for version 4 --- wish I had a source on that).

For cross-platform UI's, I use web-view. The UI is written in TypeScript/React (and built with esbuild), and it calls into Rust to perform low-level operations.

Collapse
 
thefluxapex profile image
Ian Pride

Thank you. From reading a little bit it looks like web-view is for web based stuff, no? I won't get into why, but I have a low tolerance for web based anything and I pretty much only build software for myself and a few family and friends, so it'll all be natively installable/executable.

I already plan on checking out gtk-rs, especially since I have plenty of experience with GTK.

Thanks again.

Collapse
 
jrop profile image
Jonathan Apodaca

Yep, it is an embedded browser window (but it uses the natively-available browser engine), so the resulting executable is much smaller than any electron-app.

I won't get into why, but I have a low tolerance for web based anything

Yeah, I can't wait for pure-Rust GUI solutions, but for now this is the best way I've found to do cross-platform.

Thread Thread
 
thefluxapex profile image
Ian Pride

Very helpful; can't say thanks enough!

Collapse
 
aghost7 profile image
Jonathan Boudreau • Edited

Since this appears this is for a side-project, you could look at iced. You could also use something based off of libui like this library, since it doesn't sound like you need something of complex.

Collapse
 
thefluxapex profile image
Ian Pride

Someone on Twitter recommended iced as well. Thank you very much.