GitHub - artemtsitronov/glacex: GPU-Rendered UI library built from scratch in Rust [WIP]

GitHub

3 min read Original article ↗

demo

crates.io docs.rs MIT rustc 1.85+ GitHub stars

a small immediate-mode ui library for rust

built with wgpu, winit, taffy, and glyphon.

glacex is early software. the api may change before 1.0.

what it is

glacex lets you build native desktop interfaces directly in rust.

the ui is described every frame with normal rust code. layout, input, widget state, animation, and rendering are handled by the library.

no markup. no native widget toolkit.

features

  • gpu rendering with wgpu
  • immediate-mode widgets
  • flexbox layout with taffy
  • text rendering with glyphon
  • buttons, inputs, sliders, tabs, selects, scroll views, cards, and more
  • persistent widget state
  • keyboard and mouse interaction
  • tooltips and focus handling
  • solid colors, gradients, and images
  • custom bezier paths
  • themes and per-widget styling
  • animations and transitions
  • optional accessibility through accesskit

install

or:

[dependencies]
glacex = "0.2.0-alpha"

quick start

use glacex::{App, Button, Color, Label, Ui, Widget, column};

struct Counter {
    count: u32,
}

impl Widget for Counter {
    type Output = ();

    fn ui(&mut self, ui: &mut Ui) {
        ui.set_bgcolor(Color::rgb(18, 18, 22));

        let mut label = Label::new(format!("count: {}", self.count));
        let mut button = Button::new("increment").id("increment");

        column![&mut label, &mut button]
            .spacing(12.0)
            .arrange_at([40.0, 40.0], ui);

        if button.clicked() {
            self.count += 1;
        }
    }
}

fn main() {
    App::new(Counter { count: 0 }).run();
}

building

glacex currently targets systems supported by wgpu.

you need:

  • rust 1.85+
  • a supported gpu backend
  • wayland or x11 on linux

linux dependencies:

# debian / ubuntu
sudo apt install libx11-dev libxcursor-dev libxrandr-dev libxi-dev libxkbcommon-dev libwayland-dev

# fedora
sudo dnf install libX11-devel libXcursor-devel libXrandr-devel libXi-devel libxkbcommon-devel wayland-devel

# arch
sudo pacman -S libx11 libxcursor libxrandr libxi libxkbcommon wayland

widgets

glacex currently includes:

Button · Checkbox · RadioButton · Switch · Slider · ProgressBar · TextInput · TextArea · SelectBox · Tabs · ScrollView · Card · Container · Badge · Divider · Label

widgets are regular rust values, so custom widgets can implement the same Widget trait.

styling

styles can be changed per widget or through built-in themes.

included themes:

light · dark · catppuccin mocha · catppuccin latte · tokyo night · gruvbox dark · gruvbox light · nord · rose pine

fills support:

  • solid colors
  • linear gradients
  • radial gradients
  • conic gradients
  • images

custom shapes can be drawn with kurbo paths.

accessibility

glacex can expose widgets through accesskit for assistive technologies on supported platforms.

App::new(root)
    .accessibility_enabled(true)
    .run();

examples

cargo run --example demo
cargo run --example themes
cargo run --example example1
cargo run --example example2
cargo run --example reminder
cargo run --example free_shape

documentation

for the complete api, see docs.rs.

contributing

bug reports, improvements, and pull requests are welcome.

see CONTRIBUTING.md before opening a pull request.

license

MIT. see LICENSE.

copyright © 2026 artem tsitronov and glacex contributors.