longbridge /gpui-kit
Rust GUI components for building fantastic cross-platform desktop application by using GPUI.
★ 20,749⑂ 1,272👁 56⑃ 3,062● 805▤ 20
+68
日增长
+1,802
周增长
+3,773
月增长
20,749
stars
1,272
forks
56
watchers
3,062
prs
805
issues
20
releases
README
GPUI Kit
English | 简体中文
使用 Rust 和 GPUI 构建出色、高性能的桌面应用。
GPUI Kit 是一个综合性的 Rust 桌面应用开发框架。它将生产级 UI
系统、应用级数据与布局能力、编辑能力,以及可复用的行为、状态和基础设施整合在一起,
并让交付后的应用可以被 JavaScript 扩展。GPUI Kit 提供 75+ 个有完整文档的组件与原语,
并具备 WebAssembly、AccessKit 无障碍、UI 集成测试及可选的 JavaScript 扩展运行时。
文档:
text
gpui-kit 应用唯一需要依赖的 crate
├── gpui-base 无样式的行为、状态与基础设施
└── gpui-component GPUI Component:完整的带样式 UI 系统
gpui-kit 会固定配套的 GPUI 版本并导出 GPUI、base、component 和 assets,Rust 应用只需声明这一个依赖。JavaScript 扩展宿主另行依赖 gpui-shell;它默认开启的 components feature 提供带样式的组件目录。
特性
- 75+ 组件与原语:覆盖表单、导航、浮层、数据展示、编辑、反馈和布局等场景,提供成熟交互与高效默认值。
- 生产就绪:从第一天起用于构建 Longbridge Pro,并在公开发布的商业桌面应用中持续打磨。
- WebAssembly:应用与组件示例可通过 wasm32-unknown-unknown 在 Web 中运行。
- 无障碍:交互层内置 AccessKit role、name、state、relationship 与 action,并有对应测试覆盖。
- UI 集成测试:在 headless window 中渲染真实组件,驱动鼠标与键盘输入,并验证状态、Focus、布局和无障碍信息。
- 原生体验:现代控件设计灵感来自 macOS 与 Windows,并提供语义化主题和多种尺寸。
- 120 FPS:GPU 加速界面,在高负载下依然保持流畅。
- 数据表格:虚拟滚动、固定列、列宽调整、排序与单元格选择,可承载数十万行数据。
- 虚拟列表:只渲染可见区域,并支持不同尺寸的列表项。
- 代码编辑器:20 万行规模下仍保持稳定,集成 Tree-sitter 高亮与 LSP 诊断、补全和悬浮提示。
- Dock 布局:可调整面板、可拖拽标签、嵌套分割、边缘停靠,并可序列化保存。
- 丰富内容:原生 Markdown 与 HTML 渲染、语法高亮和内置图表。
- 设计自由:使用完整视觉系统,或基于 gpui-base 的行为与基础设施构建自己的系统。
- JavaScript 扩展:gpui-shell 让已发布的 Rust 宿主以脚本方式加载面板与业务逻辑,每项能力都需显式授予。
- 跨平台:通过一份 Rust 代码交付 macOS、Windows 和 Linux。
框架架构
三层架构,一个生态
使用 gpui-component,让整个应用保持统一、完整的视觉与交互风格;当产品需要创建并拥有自己的设计系统时,使用 gpui-base;当应用需要在交付后仍可被 JavaScript 扩展时,使用 gpui-shell。
| gpui-component | gpui-base | gpui-shell |
| ------------------------ | -------------------------- | -------------------------------- |
| 完整且带样式的组件 | 无预设样式的行为与基础设施 | 由 Rust 托管的 JavaScript 运行时 |
| 开箱即用,并支持主题定制 | 完全掌控结构与视觉设计 | 能力逐项授予 |
| 适合直接构建应用 | 适合构建设计系统 | 适合插件与脚本化应用 |
text
APPLICATION
│
┌───────────────────┼───────────────────┐
│ │ │
▼ ▼ ▼
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ gpui-component │ │ Your Design │ │ gpui-shell │
│ Styled UI │ │ System │ │ JS extensions │
└────────┬─────────┘ └────────┬─────────┘ └────────┬─────────┘
│ │ │
└────────────────────┼────────────────────┘
▼
┌──────────────────┐
│ gpui-base │
│ Behavior · State │
│ Infrastructure │
└────────┬─────────┘
▼
GPUI
行为属于基础层,呈现属于应用。
如果希望使用精致、开箱即用且风格统一的控件,请选择 gpui-component。如果应用需要拥有组件源码、布局、样式和动效,同时复用复杂且可靠的交互行为,请直接构建于 gpui-base。如果希望贡献者无需 fork、也无需发新版本就能扩展产品,请加入 gpui-shell。
这种分层方式与 shadcn 生态的灵活性来源一致:
| GPUI Kit 生态 | Web 生态 Top issues
#3008window hide show7 comments · 2026-09-08#3310Android: touch, soft keyboard and phone-width issues found testing every component of 0.7.05 comments · 2026-09-29#2967Feature Request: Advanced Animations, Responsive UI, Grid, Media, Overlays, and File Attachments5 comments · 2026-09-05#3056Inspector cannot inspect any element inside the application window4 comments · 2026-09-13#2379datatable: header bg isn't properly coloured with sorting4 comments · 2026-05-18#2073Data Visualization4 comments · 2026-02-23#1818feat(SidebarToggleButton): allow setting custom icons4 comments · 2025-12-16#3950Firefox: Click targets are offset in documentation previews3 comments · 2026-11-12
Discussions
#3981Dock: allow empty zones, show a default view, and hide empty sides.0 comments · 2026-11-14#3941write GPUI like React, this project is interesting (https://github.com/ppmpreetham/zopra)0 comments · 2026-11-12#3891Ferail: a file manager on GPUI Kit, and GPUI Kit on AROS (with thanks)0 comments · 2026-11-11#3834Stylus support and touch drawing0 comments · 2026-11-06#3666Confusing about Entity example0 comments · 2026-10-24#3634How to make the window height adapt to its content?1 comments · 2026-10-22#3597Sailry — a native AI agent harness built with GPUI Kit0 comments · 2026-10-19#3558Dock: any way to set a size range for panels?1 comments · 2026-10-16
Latest release
v0.9.1 v0.9.1 2026-11-09GPUI Kit v0.9.1 GPUI Kit 0.9.1 is a backward-compatible patch release. It adds a draggable GridLayout, right-pinned table columns, Markdown task checkboxes, link tooltips and motion transitions that outlive their element, along with a large batch of input, text, slider, accessibility and gpui-shell hardening fixes. The default backend moves to gpui-pre 0.3.12 and the optional GPUI Fast backend to 0.1.14. New APIs - GridLayout: a grid whose items the user drags and resizes, also registered in the gpui-shell component catalog. (3770, 3789) - Table: ColumnFixed::Right pins columns to the righ
相关报道 (2)
News & coverage (3)
Hacker NewsGPUI Kit v0.6.0▲ 1 · 0 comments · 2026-09-03xJason Lee on X: "GPUI Kit has over 220 contributors. https://t.co/hiJufAnmOA"2026-11-01xRust Bytes on X: "GPUI Kit v0.6.2 is out! > This release adds iOS/Android mobile support, new Carousel/Empty/InputGroup components, public editor search API, and ...2026-09-18