Skip to content
PorabuildHeroGPUI component library
v0.14.0 · Apache-2.0

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.

Apache-2.0 · macOS · Windows · Linux

Cargo.toml
[dependencies]
herogpui = "0.14"

Published on crates.io. See the Quick Start for a window you can run.

Loads HeroGPUI compiled to WebAssembly (about 5 MB, cached afterwards).
HeroGPUI compiled to WebAssembly, running in the browser.Open standalone gallery ↗
Components
67 in 15 categories
Platforms
macOS · Windows · Linux
Runtime
GPUI · WebAssembly
License
Apache-2.0
HeroGPUI

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

67 components in 15 categories, 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
use gpui::prelude::*;
use herogpui::prelude::*;

impl Render for MyApp {
    fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
        app_focus_root(div()
            .size_full()
            .bg(cx.colors().background)          // semantic token
            .font_family("Segoe UI")
            .child(
                Button::new("save")
                    .label("Save changes")
                    .variant(Variant::Primary)
                    .on_press(cx.listener(|this, _, _, cx| this.save(cx))),
            ), window, cx)
    }
}
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.