Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

GPUI Kit logo
GPUI Kit

English | 简体中文

Build Status Docs Crates.io

Build fantastic, high-performance desktop apps with Rust and GPUI.

GPUI Kit is a comprehensive Rust desktop application framework. It combines a production-ready UI system with application-grade data, layout, and editing capabilities, all built on a reusable foundation of behavior, state, and infrastructure, and opens the finished application to JavaScript extensions.

Documentation: https://gpui-kit.com

gpui-kit             The one crate applications depend on
├── gpui-base        Unstyled behavior, state, and infrastructure
├── gpui-shell       JavaScript extensions for a Rust host
└── gpui-component   GPUI Component: the complete styled UI system

gpui-kit pins the matching GPUI release and re-exports every layer, so an application lists a single dependency and never GPUI itself.

Features

  • 60+ UI Components: Forms, navigation, overlays, feedback, layout, and more, with polished interactions and productive defaults.
  • Production Ready: Used to build Longbridge Pro from day one and continuously refined in a publicly shipped commercial desktop application.
  • Native Feel: Modern controls inspired by macOS and Windows, backed by semantic themes and multiple sizes.
  • 120 FPS: GPU-accelerated interfaces that remain smooth under load.
  • Data Tables: Virtual scrolling, fixed and resizable columns, sorting, and cell selection across hundreds of thousands of rows.
  • Virtual Lists: Render only the visible range, including lists whose items have different sizes.
  • Code Editor: Stable performance at 200K lines with Tree-sitter highlighting and LSP diagnostics, completion, and hover.
  • Dock Layout: Resizable panels, draggable tabs, nested splits, edge docks, and serializable freeform Tiles.
  • Rich Content: Native Markdown and HTML rendering, syntax highlighting, and built-in charts.
  • Design Freedom: Use the complete visual system or build your own on the behavior and infrastructure in gpui-base.
  • JavaScript Extensions: gpui-shell lets a shipped Rust host load panels and business logic as scripts, with every capability granted explicitly.
  • Cross Platform: Ship one Rust codebase to macOS, Windows, and Linux.

Framework Architecture

Three layers. One ecosystem.

Use gpui-component to keep the application coherent with one complete visual and interaction system. Use gpui-base when your product needs to create and own that system itself. Use gpui-shell when the application should be extensible in JavaScript after it ships.

gpui-componentgpui-basegpui-shell
Complete, styled componentsUnstyled behavior and infrastructureJavaScript runtime hosted by Rust
Productive defaults with themingFull control over structure and visual designCapabilities granted one at a time
Best for building applicationsBest for building design systemsBest for plugins and scripted applications
                             APPLICATION
                                  │
              ┌───────────────────┼───────────────────┐
              │                   │                   │
              ▼                   ▼                   ▼
    ┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
    │  gpui-component  │ │ Your Design      │ │    gpui-shell    │
    │    Styled UI     │ │ System           │ │  JS extensions   │
    └────────┬─────────┘ └────────┬─────────┘ └────────┬─────────┘
             │                    │                    │
             └────────────────────┼────────────────────┘
                                  ▼
                        ┌──────────────────┐
                        │    gpui-base     │
                        │ Behavior · State │
                        │ Infrastructure   │
                        └────────┬─────────┘
                                 ▼
                               GPUI

Behavior belongs to the foundation. Presentation belongs to the application.

Use gpui-component when you want polished controls ready to ship. Build on gpui-base when your application should own its component source, layout, styling, and motion while reusing difficult interaction behavior. Add gpui-shell when contributors should extend the product without a fork or a release.

The layering follows the same separation that makes the shadcn ecosystem flexible:

GPUI Kit ecosystemWeb ecosystem
GPUIHTML + Tailwind CSS
gpui-baseBase UI
gpui-componentshadcn's styled component layer

Explore the architecture →

Showcase

GPUI Kit has powered Longbridge Pro from day one. The framework is extracted from the demands of a publicly shipped commercial desktop application rather than designed in isolation.

GPUI provides the rendering foundation. Longbridge provides the production foundation.

Image

Usage

[dependencies]
gpui-kit = "0.6"

gpui-kit always brings in GPUI and gpui-base; gpui-component and the default icon set are on by default. Turn default features off to keep only the layers you use. The gpui-component features (inspector, decimal, tree-sitter, and each tree-sitter-<language>) are available under the same names.

Basic Example

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| {
        // This must be called before using any GPUI Component features.
        gpui_kit::init(cx);

        cx.spawn(async move |cx| {
            cx.open_window(WindowOptions::default(), |window, cx| {
                let view = cx.new(|_| HelloWorld);
                // This first level on the window, should be a Root.
                cx.new(|cx| Root::new(view, window, cx))
            })
            .expect("Failed to open window");
        })
        .detach();
    });
}

Icons

The default assets feature bundles the Lucide icon set as gpui-kit-assets; pass it to the application with gpui_kit::application().with_assets(gpui_kit::assets::Assets). To ship your own icons instead, leave that feature out and name the SVG files as defined in IconName.

Skills for AI Coding Agents

Install the GPUI Kit skills for your AI coding agent (Cursor, Claude Code, Gemini CLI, Codex, etc.):

npx skills add longbridge/gpui-kit
SkillDescription
gpui-kitSetup, component catalog, usage patterns, GPUI mechanics (elements, entities, async, focus, actions, tests), and the Coding Guides.
gpui-kit-design-guidesThe Design Guides: layout, spacing, hierarchy, interaction states, overlays, and interface copy.

Development

Desktop Gallery (Story)

The story crate is a gallery application that showcases all available components. Run it with:

cargo run

Examples

Some important examples are built into the story crate and can be run directly:

# Code editor with LSP support and syntax highlighting
cargo run --example editor

# Dock layout system (panels, split views, tabs)
cargo run --example dock

# Markdown rendering
cargo run --example markdown

# HTML rendering
cargo run --example html

The examples directory also contains standalone examples, each focused on a single feature. Each example is a separate crate, run them with cargo run -p <name>:

# Basic hello world
cargo run -p hello_world

# System monitor (real-time charts with CPU/memory data)
cargo run -p system_monitor

# Window title customization
cargo run -p window_title

Check out CONTRIBUTING.md for more details.

Compare to others

See the comparison with Iced, egui and Qt 6 on the site.

License

Apache-2.0

  • Built on GPUI, the UI framework from Zed Industries, also Apache-2.0. The gpui-pre-* crates are snapshots of it, published with Zed's license and notices intact.
  • UI design based on shadcn/ui, some from Reui.
  • Icons from Lucide.

关于 About

Rust GUI components for building fantastic cross-platform desktop application by using GPUI.
desktop-applicationgpuirustuikit

语言 Languages

Rust96.7%
Vue1.1%
TypeScript0.8%
JavaScript0.4%
CSS0.3%
Tree-sitter Query0.3%
HTML0.1%
Shell0.1%
Python0.0%
Lua0.0%
Svelte0.0%
Kotlin0.0%
Astro0.0%
C0.0%
Zig0.0%
Nix0.0%
Ruby0.0%
Go0.0%
Makefile0.0%
PHP0.0%
PowerShell0.0%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
1099
Total Commits
峰值: 64次/周
Less
More

核心贡献者 Contributors