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.
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.
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.
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}What you get
The pieces desktop apps need
Typed builders, explicit state and semantic tokens keep the API close to the UI you render.
OKLCH semantic tokens
Define base colors, surfaces and roles with OKLCH semantic tokens. Hover, soft and foreground variants derive from each base color.
Typed Rust builders
Build interfaces from typed Rust builders. The API stays close to the structure you render.
Controlled or uncontrolled state
Choose controlled state with is_selected, is_open or selected_key, or let a component manage its own default.
Validation for fields and forms
Use validation::resolve for field state. Form carries submit, invalid and reset handlers.
Reduced-motion support
Components respect reduced-motion settings, including overlay transitions.
A desktop gallery
Open the gallery for examples of every component, with a theme switcher and deep links for captures.
The index
Find the right component
Browse the library by category. Each category links to the component index and its examples.
- ButtonsButton · Button Group · Close Button +14
- CollectionsDropdown · List Box · Tag Group3
- ColorsColor Area · Color Field · Color Picker +36
- ControlsSlider · Switch2
- Data displayBadge · Chip · Table3
- Date and timeCalendar · Date Field · Date Picker +36
- FeedbackAlert · Meter · Progress Bar +36
- FormsCheckbox · Checkbox Group · Fieldset +1013
- LayoutCard · Separator · Surface +14
- MediaAvatar1
- NavigationAccordion · Breadcrumbs · Disclosure +36
- OverlaysAlert Dialog · Drawer · Modal +36
- PickersAutocomplete · Combo Box · Select3
- TypographyKbd · Typography2
- UtilitiesScroll Shadow1
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.