gnui 0.0.1-alpha.2

A GUI library to design apps for GNOME and beyond
Documentation
  • Coverage
  • 42.86%
    3 out of 7 items documented0 out of 5 items with examples
  • Size
  • Source code size: 67.53 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.14 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1m 56s Average build duration of successful builds.
  • all releases: 1m 15s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • l0uisgrange

GNUI

GNUI (pronounced /ʒe.ɛn.y.i/) is a high-performance, modern alternative to GTK, designed specifically for GNOME. It is built from the ground up in pure Rust to provide the "Adwaita" look and feel without the legacy baggage of C, GObject, or complex FFI bindings.

Documentation

Motivation

Developing GNOME apps with gtk4-rs often feels like fighting the tool rather than building the app. The numerous C dependencies bring exhausting issues when bound to Rust. GNUI and its dependencies are full Rust, and directly usable in your project using one simple import.

Thinking of a Rust-native framework for GNOME also brought the opportunity to make the library more "rusty": easier and more intuitive.

Why not use Iced or Slint?

GTK is at the core of GNOME's UI experience. Iced and Slint both come with specific design choices that don't match GNOME's environment. GNUI comes by default with libatawia's look, and displays native-looking GNOME components.

Installation

# yeah, it's that simple
cargo add gnui

Quick example

Use a declarative approach that feels natural in Rust.

fn view(state: &AppState) -> Element {
    Column::new()
        .padding(12)
        .spacing(8)
        .add(
            HeaderBar::new()
                .title("My App")
                .show_close_button(true)
        )
        .add(
            Button::with_label("Click Me")
                .accent_style()
                .on_click(Message::Increment)
                .border(2.0)
        )
}