返回资讯中心
外部精选
软件工程
#开发者实时流

Rust GPUI-Kit with components

A production-ready Rust UI framework with 75+ components and primitives, WebAssembly, accessibility, UI integration testing, data tables, docking, charts, code editing, and JavaScript extensions.

Hacker News 最新modinfo2026/11/23 · 今天9 分钟阅读

以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。

A production-ready Rust UI framework with 75+ components and primitives, WebAssembly, accessibility, UI integration testing, data tables, docking, charts, code editing, and JavaScript extensions.

Browse components

21.2k stars on GitHub

Software · Apache-2.0

macOS, Windows, Linux, WebAssembly

Cargo.tomlgpui-kit = "0.11.0"

main.rs

use gpui_kit::component::{button::*, *};

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

Native Shell: Build once, native everywhere

RecommendedCrafted by the GPUI Kit team

GPUI Kit is made for the desktop. For mobile, the web, the terminal, dynamic delivery or embedding in apps, Native Shell is the better choice.

The systems that real desktop applications need are integrated into one framework.

High refresh support

Update on demand. A 120 Hz display gives each frame about 8.3 ms; smoothness depends on the whole UI and device.

Complex data tables

Virtual scrolling, fixed and resizable columns, sorting and cell selection across hundreds of thousands of rows.

Virtualized lists

Only the visible range is rendered, so very long lists keep scrolling smoothly.

A real code editor

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

Dockable panels with drag-to-rearrange and zooming — all serializable.

Multi-theme support

Light, dark and custom themes driven by semantic tokens instead of endless style fields.

WebAssembly

Applications and component showcases run on the web through wasm32-unknown-unknown while sharing their native implementation.

Web

Accessibility

AccessKit roles, names, states, relationships and actions are built into the interaction layer.

buttonroleSendnamepressaction

UI integration testing

Render real components in headless windows, drive pointer and keyboard input, and assert state, focus, layout and accessibility.

renderinputassert

Three layers. One ecosystem.Choose who owns the visual system.

Use gpui-component for a coherent product, build and own your design system on gpui-base, or open the application to JavaScript extensions with gpui-shell.

gpui-component

Keep the product coherent

gpui-component provides a complete, polished visual and interaction system ready to ship.

Button::new("save") .primary() .label("Save changes") .on_click(cx.listener(Self::save))

75+ components and primitives

Light and dark themes included

Interaction details already handled

Get started gpui-base

Own the design system

Reuse focus, selection, overlay and virtualization behavior while owning every pixel.

Button::new("save") .on_click(cx.listener(Self::save)) .rounded_md() .child("Save changes")

Zero-style primitives

Full accessibility behavior

100% visual ownership

Read the gpui-base docs gpui-shell

Extend it in JavaScript

The host stays Rust and grants what a script may reach, one capability at a time; the script draws real interface in the same process.

import { Button, text } from "gpui";

Button.new("save") .on_click((_e, cx) => this.save(cx)) .child(text("Save changes"))

Extend the product without a fork or a release

No capability granted by default

Hot-reload on save, no restart

Explore gpui-shell

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.

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →