Native dialogs

From Rust Community Wiki

Native dialogs are dialogs which can be created and used through APIs which are provided by the operating system. Some dialogs are modal and block all interaction with the parent window, and some are modeless and behave mostly like regular windows.

Some examples of native dialogs are:

  • File dialogs
  • The "about" dialog
  • Modal "confirmation" dialogs

There are a couple of crates which allow you to create different kinds of dialogs.

Pure Rust

Most of these crates can't implement all of their functionality in Rust since they have to call either OS-provided code on Windows and macOS, or use GTK/Qt or shell out to KDialog or Zenity on Linux. Despite this, we consider them "pure Rust" if they don't include a C "native dialog" library as a part of their build process.

Crate name Status (latest version) Development status (last updated) File dialog Message box Windows macOS Linux Notes
Cargo vec.svgdialog 0.3.0 yes yes no no KDialog, Zenity Can also use the similarly named dialog tool to display a dialog via ncurses. Can also use the terminal directly in the absence of any external tools. You can either choose which tool to use (or not use any tool) or let the library choose for you.
Cargo vec.svgdialog-box 0.1.0 yes yes no no Zenity Also supports a date picker and a message box with a text input.
Cargo vec.svgmsgbox 0.7.0 no yes yes yes GTK Intentionally only exposes message boxes with a single "Ok" button.
Cargo vec.svgnative-dialog 0.6.4 yes yes yes yes KDialog, Zenity Uses Cargo vec.svgwfd 0.1.7 for file dialogs and Cargo vec.svgwinapi 0.3.9 for message boxes on Windows. Uses Cargo vec.svgosascript 0.3.0 on macOS.
Cargo vec.svgwfd 0.1.7 yes no yes no no Calls Windows APIs through Cargo vec.svgwinapi 0.3.9 .

Rust Wrappers

Crate name Status (latest version) Development status (last updated) File dialog Message box Windows macOS Linux Wraps Notes
Cargo vec.svgnfd 0.0.4 yes no yes yes GTK nativefiledialog (C) nativefiledialog can optionally shell out to Zenity so that you can avoid depending on GTK, but nfd does not expose this option.
Cargo vec.svgnfd2 0.3.1 yes no yes yes GTK nativefiledialog (C) Fork of Cargo vec.svgnfd 0.0.4 by Embark Studios, created due to concerns about a lack of bug-fixing from nfd's maintainer. The repository's README claims that they wish to eventually replace all C code with Rust.
Cargo vec.svgpicker 0.1.1 yes unknown unknown yes unknown nativefiledialog (C) Despite being based on nativefiledialog, the README only claims support for macOS.
Cargo vec.svgtinyfiledialogs 3.9.1 yes yes yes yes KDialog, Zenity tinyfiledialogs (C) Most downloaded crate by a wide margin as of July 2020 according to
Cargo vec.svgtauri-dialog 0.1.1 no yes yes yes GTK Boxer (C++) Uses a forked version of Boxer, which is a C++ library. The forked version has changed the implementation language to C.