FAQ - Help and questions

Which GUI toolkit should I use for a desktop app in Rust: egui, iced, Slint or Tauri?

#desktop#gui#egui#iced#slintpublished 0 replies0 views
ReplyWatch
Share
Hacker NewsRedditLinkedInE-mail

Short answer

All four run on Windows and macOS. egui is a small immediate-mode library that suits tools and editors, iced follows the Elm model, Slint describes the window in its own markup language and has a licence to check, and Tauri shows a web page in the system web view. Pick by how you want to write the interface.

Checked with rustc 1.93.0, Windows 11; a minimal window from eframe 0.35.0 and iced 0.13 passed `cargo check`; the Slint and Tauri examples were not compiled here.

Frequently asked question, written and answered by the Ruststudio team. Replies are open: corrections are welcome.

#1

Answer#

There is no single best toolkit. The four differ mainly in how you describe the window and where the drawing happens, and that is what to choose on.

ToolkitYou describe the window withState lives inDrawing
egui (with eframe)Rust code that runs every frame ("immediate mode")your own structthe library draws everything itself
icedRust: a view function that returns widgets from the state, and an update function that handles messages (the Elm architecture)your own structthe library draws everything itself
Slintits own markup language (.slint, or inline with the slint! macro), plus Rust callbacksproperties in the markup, set from Rustthe library draws everything itself
TauriHTML, CSS and JavaScript (or a framework for them), with Rust as the back endthe web page, and Rust commandsthe operating system's web view

How to choose:

  1. A tool, an editor, a debug panel, something you build fast and change often: egui. The window is plain Rust, so there is no second language and no build step for the interface.
  2. You like a strict "state, message, update, view" structure and want the compiler to check every transition: iced.
  3. A designer or a second person edits the layout, or you want a declarative language with its own preview: Slint. Check its licence first (see below).
  4. You already have a web front end, or the interface is mostly text, forms and rich HTML: Tauri.

Licences matter for closed-source programs. egui and eframe are offered under MIT or Apache-2.0. Slint is offered under GPL-3.0, a royalty-free licence with conditions, or a paid commercial licence; read https://slint.dev/terms-and-conditions before shipping a closed-source app. Check the licence of every dependency, including the one you did not choose on purpose.

All four can produce a program for Windows and macOS from one code base. Each of the first three has its own thread in this category; the egui and iced windows were compiled, the Slint one was not.

Common mistakes#

  • Choosing by a screenshot. Check the things your app needs (text input in your languages, right-to-left text, accessibility, native menus, many windows) against the toolkit's own documentation before you commit.
  • Mixing two toolkits in one window. Pick one per window.
  • Forgetting the licence until release day.

Is egui "native"?#

egui and iced draw their controls themselves, so they look the same on every system. Slint draws its own widget styles, and its documentation lists which styles exist; Tauri's interface is a web page. If you need controls that look exactly like the system's, read each toolkit's documentation for what it offers.

Can I change my mind later?#

The business logic (parsing, files, networking, settings) does not depend on the toolkit if you keep it in its own module or crate that knows nothing about windows. Only the thin layer that connects it to the screen is rewritten.

Sources#

    QuoteReply
    Share
    Hacker NewsRedditLinkedInE-mail

    No replies yet