Glacex — a gpu-rendered immediate-mode ui library built from scratch in rust

glacex — a gpu-rendered immediate-mode ui library built from scratch in rust

i've been working on glacex, an early-stage immediate-mode gui library for rust, built from scratch on top of wgpu, winit, and taffy.

the main idea is to keep the ui entirely in rust without a native toolkit, browser engine, or separate markup language. widgets are rebuilt every frame, while state is retained separately through stable widget ids.

the renderer uses instanced sdf quads for rounded rectangles, borders, and shadows, with glyphon for text rendering. layouts use taffy, and everything is submitted through a single gpu command buffer per frame.

currently it has:

  • buttons, inputs, text areas, sliders, switches, checkboxes and radio buttons
  • flexbox-style row![] and column![] layouts
  • gradients, shadows and custom widget styles
  • persistent widget state and keyboard focus navigation
  • animations and spring/easing presets
  • scroll views and auto-hiding scrollbars
  • built-in themes including catppuccin, tokyo night, gruvbox, nord and rose pine
  • optional accesskit accessibility support
  • linux, windows and macos support through winit/wgpu

a minimal application looks roughly like this:

struct Counter {
    count: u32,
}

impl Widget for Counter {
    type Output = ();

    fn ui(&mut self, ui: &mut Ui) {
        let mut label = Label::new("count", format!("count: {}", self.count));
        let mut button = Button::new("increment", "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();
}

the project is still very much pre-1.0, so the api is expected to change. i'm particularly interested in feedback on the architecture, widget/state model, rendering approach, and whether this style of immediate-mode api feels natural for larger applications.

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

crates.io: crates.io: Rust Package Registry

would love to hear what you think, especially from people who have built or used rust gui toolkits.

feel free to explore it, open an issue or pr if you have feedback or improvements, and leave a star if you find it interesting.