Gpui-component: Rust GUI components for building cross-platform apps

klaussilveira1 pts0 comments

GPUI Component

Are you an LLM? View /gpui-component/llms.txt for optimized Markdown documentation, or /gpui-component/llms-full.txt for full documentation bundle<br>Search 12.7k中

Built on GPUI — the renderer behind Zed Build native desktop apps in Rust.<br>A UI library for GPUI, the GPU-accelerated renderer behind the Zed editor. Data tables, docking, charts and a code editor included — one Rust source, shipping to macOS, Windows and Linux.<br>Get started Browse components<br>12.7k stars on GitHub<br>Apache-2.0<br>macOS, Windows, Linux<br>Cargo.tomlgpui-component = { git = "https://github.com/longbridge/gpui-component" }

main.rs<br>use gpui_component::{button::*, *};

impl Render for HelloWorld {<br>fn render(&mut self, _: &mut Window, cx: &mut Context) -> impl IntoElement {<br>div()<br>.v_flex()<br>.gap_2()<br>.items_center()<br>.child("Hello, World!")<br>.child(<br>Button::new("ok")<br>.primary()<br>.label("Let's Go!")<br>.on_click(cx.listener(Self::go)),

DataTable — gpui-componentLive WASM

120 FPS rendering

Every frame is drawn by the GPU, so dense interfaces stay smooth instead of dropping frames.<br>RenderOnce<br>GPU

Complex data tables

Virtual scrolling, fixed and resizable columns, sorting and cell selection across hundreds of thousands of rows.<br>Table<br>DataTable

Virtualized lists

Only the visible range is rendered, so very long lists keep scrolling smoothly.<br>VirtualList<br>List

A real code editor

Rope-backed text that stays stable at 200K lines, with Tree-sitter highlighting and LSP diagnostics, completion and hover.<br>Rope<br>Tree-Sitter<br>LSP<br>Highlighter

Freeform dock layout

Dockable panels with drag-to-rearrange, zooming and freeform tiles — all serializable.<br>DockArea<br>Tiles<br>TabPanel

Multi-theme support

Light, dark and custom themes driven by semantic tokens instead of endless style fields.<br>Theme<br>ThemeColor<br>ActiveTheme

gpui-component<br>Ship the complete application<br>Themes, data-heavy controls, docking, charts and an editor are ready to use.<br>Button::new("save")<br>.primary()<br>.label("Save changes")<br>.on_click(cx.listener(Self::save))60+ finished components<br>Light and dark themes included<br>Interaction details already handled<br>Get started<br>gpui-base<br>Create the design system<br>Reuse focus, selection, overlay and virtualization behavior while owning every pixel.<br>Button::new("save")<br>.on_click(cx.listener(Self::save))<br>.rounded_md()<br>.child("Save changes")Zero-style primitives<br>Full accessibility behavior<br>100% visual ownership<br>Read the gpui-base docs

PrincipleBehavior belongs to the foundation.Presentation belongs to the application.

gpui-base handles the difficult interaction mechanics — focus, overlay positioning, virtualization and accessibility. Your product decides how they should look and feel.<br>Explore gpui-base

Icon resources by Lucide and Isocons.

gpui component save editor button self

Related Articles