Favicon of gpui-kit

gpui-kit

GPUI Kit is a Rust desktop UI framework with 75+ components, data tables, a code editor, and accessibility, built on GPUI.

gpui-kit website screenshot
gpui-kit GitHub repository preview

GPUI Kit is a Rust desktop application framework built on top of GPUI, the GPU-accelerated UI framework from Zed Industries. It bundles a styled component system, an unstyled behavior layer, and an optional JavaScript extension runtime into a single crate. It's aimed at Rust developers building cross-platform desktop apps who want a ready-made set of UI primitives instead of assembling one from scratch on top of raw GPUI.

The project is split into layered crates: gpui-base provides unstyled behavior, state, and infrastructure; gpui-component adds the full styled UI system on top of it; gpui-shell adds a JavaScript extension host for apps that need to be scriptable after shipping. The gpui-kit crate re-exports all of this so an application only needs one dependency. The framework originated from and powers Longbridge Pro, a shipped commercial desktop app, rather than being built in isolation.

Key features

  • Component catalog: 75+ documented components and primitives covering forms, navigation, overlays, data display, editing, feedback, and layout.
  • Data tables: virtual scrolling, fixed and resizable columns, sorting, and cell selection across hundreds of thousands of rows.
  • Virtual lists: renders only the visible range, including variable-size items.
  • Code editor: stable at 200K lines, with Tree-sitter syntax highlighting and LSP diagnostics, completion, and hover.
  • Dock layout: resizable panels, draggable tabs, nested splits, and edge docks, all serializable.
  • Rich content rendering: native Markdown and HTML rendering, syntax highlighting, and built-in charts.
  • Accessibility: AccessKit roles, names, states, relationships, and actions built into the interaction layer and covered by tests.
  • UI integration testing: render real components in headless windows and drive pointer/keyboard input to assert state, focus, layout, and accessibility.
  • WebAssembly target: apps and component showcases run on the web via wasm32-unknown-unknown.
  • JavaScript extensions: gpui-shell lets a shipped Rust host load panels and business logic as scripts, with capabilities granted explicitly.
  • Layered architecture: use the full styled layer, build your own design system on gpui-base, or add scriptability with gpui-shell.
  • Cross-platform: one Rust codebase targets macOS, Windows, and Linux.

Ideal use cases

GPUI Kit fits teams building production desktop apps in Rust that need polished native-feeling controls (forms, tables, docks, editors) without hand-rolling them on top of GPUI. It's a good match for apps that need to display large datasets (virtual tables/lists), embed a code editor with LSP support, or support complex panel/dock layouts like an IDE or trading terminal.

It also works for teams that want to define their own design system but reuse interaction behavior; in that case, build directly on gpui-base instead of the styled gpui-component layer. If the app needs to be extended by third parties or scripts after release, gpui-shell adds a sandboxed JavaScript runtime for that.

This is not a fit for web apps needing a browser-based UI stack, or for teams not working in Rust. It's also not the right choice if you need a mature, long-established GUI toolkit with a large existing ecosystem (see the project's own comparison with Iced, egui, and Qt 6) or if your app targets mobile platforms, which aren't mentioned as supported targets.

Installation

Add the crate to a Rust project's Cargo.toml:

[dependencies]
gpui-kit = "0.7"

gpui-kit always includes GPUI and gpui-base; gpui-component and the default icon set are enabled by default. Disable default features to keep only the layers you need. Optional features like inspector, decimal, tree-sitter, and per-language tree-sitter-<language> features are available under the same names as in gpui-component.

A minimal app looks like this:

use gpui_kit::component::button::*;
use gpui_kit::component::*;
use gpui_kit::*;

pub struct HelloWorld;
impl Render for HelloWorld {
    fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {
        div().v_flex().gap_2().size_full().items_center().justify_center()
            .child("Hello, World!")
            .child(Button::new("ok").primary().label("Let's Go!").on_click(|_, _, _| println!("Clicked!")))
    }
}

fn main() {
    gpui_kit::application().run(move |cx| {
        gpui_kit::init(cx);
        gpui_kit::open_window(WindowOptions::default(), cx, |_, cx| cx.new(|_| HelloWorld))
            .expect("Failed to open window");
    });
}

To try the component gallery or examples from the repo, clone it and run:

cargo run              # Desktop Gallery (Story)
cargo run -p example-dock
cargo run -p example-editor
cargo run -p example-markdown

AI coding agents (Cursor, Claude Code, Gemini CLI, Codex) can pull in project-specific skills with npx skills add longbridge/gpui-kit.

Frequently asked questions

Share:

Stars
18.1K
Forks
1.1K
Last commit
4 hours ago
Repository age
2 years
Self-hosted
No
Activity score
81/100
View Repository
Ad
Favicon

 

  
 

Similar to gpui-kit

Favicon

 

  
 
Favicon

 

  
 
Favicon