Porabuild / open source / built on GPUI

A Rust UI library for desktop apps.

HeroGPUI is a component library for Rust desktop applications. Built on GPUI, the GPU-accelerated framework behind Zed, it gives you typed builders, OKLCH semantic tokens, and light and dark themes.

Cargo.toml
1[dependencies]
2gpui = { git = "https://github.com/zed-industries/zed", rev = "ee3b5558c581429633937e458fad8d109f29e9ee" }
3gpui_platform = { git = "https://github.com/zed-industries/zed", rev = "ee3b5558c581429633937e458fad8d109f29e9ee", features = ["font-kit", "wayland", "x11", "runtime_shaders"] }
4herogpui = { path = "../HeroGPUI/crates/herogpui" }

The library is added as a git/path dependency. See the Quick Start for a window you can run.

Loading the Button example
HeroGPUI compiled to WebAssembly, running in the browser.Open standalone gallery ↗
HeroGPUI

HeroGPUI is a UI library for Rust desktop applications, built on GPUI.

71 components on 66 pages, OKLCH semantic tokens, typed Rust builders, and a desktop gallery — for Windows, macOS and Linux from one codebase.

Rust code, native output

A builder beside the result

This is a real Rust builder. Beside it is the Button component compiled to WebAssembly and rendered live by GPUI in your browser.

main.rs
1use gpui::prelude::*;
2use herogpui::prelude::*;
3
4impl Render for MyApp {
5    fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
6        app_focus_root(div()
7            .size_full()
8            .bg(cx.colors().background)          // semantic token
9            .font_family("Segoe UI")
10            .child(
11                Button::new("save")
12                    .label("Save changes")
13                    .variant(Variant::Primary)
14                    .on_press(cx.listener(|this, _, _, cx| this.save(cx))),
15            ), window, cx)
16    }
17}
HeroGPUI compiled to WebAssembly, running in this frame.

What you get

The pieces desktop apps need

Typed builders, explicit state and semantic tokens keep the API close to the UI you render.

  1. OKLCH semantic tokens

    Define base colors, surfaces and roles with OKLCH semantic tokens. Hover, soft and foreground variants derive from each base color.

  2. Typed Rust builders

    Build interfaces from typed Rust builders. The API stays close to the structure you render.

  3. Controlled or uncontrolled state

    Choose controlled state with is_selected, is_open or selected_key, or let a component manage its own default.

  4. Validation for fields and forms

    Use validation::resolve for field state. Form carries submit, invalid and reset handlers.

  5. Reduced-motion support

    Components respect reduced-motion settings, including overlay transitions.

  6. A desktop gallery

    Open the gallery for examples of every component, with a theme switcher and deep links for captures.

For coding agents

A repository your agent can navigate

The repository includes a machine-readable API reference, repository guidance, and task guides. Give your agent the same context you use.

Porabuild / open source

Build your desktop UI in Rust.

HeroGPUI ships with a desktop gallery and documentation for every component. Build from one codebase on Windows, macOS or Linux.