Introduction
Build native desktop interfaces in Rust with typed HeroGPUI components, semantic themes, and GPUI.
What is HeroGPUI
HeroGPUI is a UI library for Rust desktop applications built on GPUI, the GPU-accelerated framework behind the Zed editor. It runs on Windows, macOS and Linux from one codebase, with typed builders, explicit component state, OKLCH semantic tokens and a desktop gallery.
The workspace separates shared types and color math, theme tokens, component builders and the umbrella crate:
| Crate | What it holds |
|---|---|
herogpui | Umbrella crate and prelude for building HeroGPUI applications. |
herogpui-core | Shared types such as Color, Variant, FieldVariant, Prominence, Backdrop and Size, plus OKLCH and Oklab color math. |
herogpui-theme | Semantic OKLCH colors, layout tokens and the ThemeProvider. |
herogpui-components | Typed component builders and their state behavior. |
What you get
- Native rendering — GPUI renders the interface without a browser DOM.
- Typed builders — component options are Rust types, and state is explicit and either controlled or uncontrolled.
- Semantic themes — OKLCH colors, layout tokens, light and dark themes, and reduced-motion support are shared across components.
- One codebase — target Windows, macOS and Linux with the same Rust API.
Highlights
66 components
The catalog indexes every component as focused pages, grouped by what they help you build. Related builders share a page.
Semantic themes
OKLCH roles, surfaces and field tokens with derived hover and soft variants in light and dark themes.
Gallery & docs
A desktop gallery ships with the library and documents every component with runnable examples.
Build from the public surface
The component pages, theme guides and root llms.txt describe the public Rust API. Start with the herogpui prelude, then use the component reference and gallery examples as you compose your application.
Desktop application scope
HeroGPUI is designed for native desktop applications. Its components provide GPUI focus, keyboard and theme behavior, while your application owns the surrounding window and domain logic.
Start here
- Quick Start — a window and a button you can run.
- Gallery — every example in a native desktop app.
- Button — the first component page, with live WebAssembly and the Rust builders.
- Theming — light, dark, and the tokens every control reads.
FAQ
Is it open source?
Yes. Apache License 2.0. The repository is github.com/Porabuild/HeroGPUI.
What platforms?
Windows, macOS, and Linux from one Rust API. It is a native desktop library, not a web UI.
How do I run the examples?
The website embeds the gallery as WebAssembly on each component page. For the real window, run the desktop gallery.
How does this relate to GPUI?
GPUI is the renderer and window runtime (the engine behind Zed). HeroGPUI is the component kit you call from Rust: buttons, fields, overlays, and a theme.
Next steps
- Installation — assets, the theme provider, and platform notes.
- State — controlled and uncontrolled components.
- Composition — parts and render closures.
- Keyboard and focus — Tab, Escape, and
app_focus_root. - Components — the full catalog.
- llms.txt — the public API as plain text for agents.