
gpui-component
How to use the gpui-component UI library in GPUI applications, and the normative Design and Coding Guides that govern it. Use when building UIs with gpui-component components (Button, Input, Select, Dialog, Tabs, Sidebar, List, Table, etc.), setting up the library, handling component state or theming, finding the right component for a UI need, and also when designing layouts, spacing, visual hierarchy, or interaction states, writing interface copy, or making application architecture, state-ownership, or public API decisions.
- Installs
- 298
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/longbridge/gpui-kit --skill gpui-component- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads gpui-component automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Read This First
Before changing UI, interaction, interface language, layout, styling, components, or application architecture, read the relevant guide:
| Guide | Read before |
|---|---|
| Design Guides | Choosing components, layout, spacing, hierarchy, color, density, interaction states, overlays, interface copy |
| Coding Guides | Crate layering, RenderOnce vs Entity<T>, state ownership, ElementId, focus, async, public API, testing |
These guides are requirements, not optional inspiration. Do not copy generic web conventions, infer a design system from one existing screen, or add a control merely because the underlying feature exists. Review the finished work against both guides before considering it complete.
Read the guide file itself. Do not answer from what this page summarizes, from an existing screen in the codebase, or from training data — those are the three ways the guides get quietly ignored.
Non-negotiables
These are a floor, not a substitute. Read the guide for anything past this list.
- Never invent an API. Search the current source for the real signature. Do not translate a React, CSS, or older-GPUI example by analogy — a plausible-looking method name that does not exist is the most common failure mode here.
- Desktop before web convention. Keyboard access, window chrome, menus, dense data views, resizable regions, persistent navigation.
ButtonvsLink.Buttonfor every in-app command — useghostoroutlinewhen it should read quietly.Linkonly for external URLs and email addresses.- Tokens before values. No raw hex or
rgb(...)in application UI; usecx.theme()semantic tokens. Use rem-based helpers (p_2(),gap_3(),text_sm()) so window zoom works. Any spacing number you see quoted is the current default scale, not a literal to repeat. - State must be visible. Hover, focus, selection, disabled, loading, validation, and destructive states each need distinct, consistent treatment.
- Stable identity. Repeated elements need domain-derived
ElementIds, not list indexes. - Overlays. Escape dismisses the topmost surface and returns focus to its trigger.
- Copy. Name the object and the verb —
Delete “Roadmap”?with aDeletebutton, notAre you sure?withOK.
Documentation
- Full reference: fetch
https://gpui-kit.com/llms-full.txt - Per-component API: fetch
https://gpui-kit.com/docs/components/{name}.md- e.g.
button.md,input.md,select.md,dialog.md,data-table.md
- e.g.
- Any site page can be fetched as Markdown by appending
.mdto the URL
Quick Reference
Setup — always required:
gpui_component::init(cx); // in app.run(), must be first
Root::new(view, window, cx) // first-level view in every window
Stateless — use directly in render:
Button::new("id").primary().label("OK").on_click(|_, _, _| {})
Stateful — hold Entity<State> in struct, pass ref in render:
// in new(): let input = cx.new(|cx| InputState::new(window, cx));
// in render: Input::new(&self.input)
Sizes: .xsmall() .small() .medium() (default) .large()
Theme: cx.theme().primary · .background · .foreground · .border · .muted
Component Catalog
When you need a component, find it here. For full API, fetch its .md doc.
Input & Form
| Component | Import | Notes |
|---|---|---|
Input | input::{Input, InputState} | Stateful. Text, password, mask, validation |
NumberInput | input::{NumberInput, NumberInputEvent} | Stateful. Numeric with step |
OtpInput | input::OtpInput | Stateful. One-time password |
Select | select::{Select, SelectState} | Stateful. Dropdown picker |
Combobox | combobox::{Combobox, ComboboxState} | Stateful. Searchable select |
Checkbox | checkbox::Checkbox | Stateless. `on_click( |
Switch | switch::Switch | Stateless. Toggle |
Radio | radio::{Radio, RadioGroup} | Stateless. |
Slider | slider::{Slider, SliderState} | Stateful. |
Toggle | button::Toggle | Stateless. |
Rating | rating::Rating | Stateless. |
Stepper | stepper::Stepper | Stateless. Increment/decrement |
ColorPicker | color_picker::{ColorPicker, ColorPickerState} | Stateful. |
DatePicker | date_picker::{DatePicker, DatePickerState} | Stateful. |
Form | form::{v_form, h_form, field} | Layout container for form fields |
Display & Feedback
| Component | Import | Notes |
|---|---|---|
Button | button::{Button, ButtonGroup} | Stateless. Primary UI action |
Icon | {Icon, IconName} | Stateless. Lucide icons |
Badge | badge::Badge | Stateless. |
Tag | tag::Tag | Stateless. Closable tags |
Avatar | avatar::Avatar | Stateless. |
Label | label::Label | Stateless. Form label |
Kbd | kbd::Kbd | Stateless. Keyboard key display |
Alert | alert::Alert | Stateless. Info/success/warning/error |
Spinner | spinner::Spinner | Stateless. Loading indicator |
Skeleton | skeleton::Skeleton | Stateless. Loading placeholder |
Progress | progress::{Progress, ProgressCircle} | Stateless. |
Tooltip | tooltip::Tooltip | Via .tooltip() on elements |
HoverCard | hover_card::{HoverCard, HoverCardState} | Stateful. |
Clipboard | clipboard::Clipboard | Stateless. Copy button |
Overlay & Popups
| Component | Import | Notes |
|---|---|---|
Dialog | dialog::Dialog + WindowExt | Via window.open_dialog(...) |
AlertDialog | WindowExt | Via window.open_alert_dialog(...) |
Sheet | sheet::Sheet + WindowExt | Side panel, via window.open_sheet(...) |
Notification | notification::Notification + WindowExt | Via window.push_notification(...) |
Popover | popover::Popover | Floating overlay |
Menu | menu::{PopupMenu, DropdownMenu} | Context menus |
DropdownButton | button::DropdownButton | Button with dropdown menu |
Navigation & Layout
| Component | Import | Notes |
|---|---|---|
Tabs / TabBar | tab::{Tab, TabBar} | Tabbed interface |
Sidebar | sidebar::{Sidebar, SidebarMenu, ...} | App navigation panel |
TitleBar | TitleBar | Window title bar |
Breadcrumb | breadcrumb::Breadcrumb | Navigation breadcrumb |
Pagination | pagination::Pagination | Page navigation |
Accordion | accordion::Accordion | Collapsible sections |
Collapsible | collapsible::Collapsible | Single collapsible |
GroupBox | group_box::GroupBox | Labeled container |
Resizable | resizable::{h_resizable, v_resizable, resizable_panel, ResizableState} | Draggable split panes |
Scrollable | scroll::Scrollbar | Custom scrollbar |
FocusTrap | gpui_base::focus_trap::FocusTrapElement | Keyboard trap for modals |
Data Display
| Component | Import | Notes |
|---|---|---|
DataTable | table::{DataTable, TableState, TableDelegate} | Stateful. Full-featured table |
Table | table::{Table, ...} | Simpler table |
VirtualList | {v_virtual_list, h_virtual_list} | High-perf large lists |
List | list::{List, ListState, ListDelegate} | Stateful. Searchable list |
Tree | tree::{Tree, TreeState, TreeItem, TreeEntry} | Stateful. Hierarchy |
DescriptionList | description_list::DescriptionList | Key-value pairs |
Settings | setting::Settings | Settings panel |
Charts
| Component | Import | Notes |
|---|---|---|
Chart | chart::{AreaChart, BarChart, LineChart, PieChart, RadarChart} | Bar, line, area, pie charts |
Plot | plot::Plot | #[derive(IntoPlot)] for data |
Reference Files
- usage.md — setup patterns, component types, common examples
- style-guide.md — code style for contributors
FAQ
What does the gpui-component skill do?
How to use the gpui-component UI library in GPUI applications, and the normative Design and Coding Guides that govern it. Use when building UIs with gpui-component components (Button, Input, Select, Dialog, Tabs, Sidebar, List, Table, etc.), setting up the library, handling component state or theming, finding the right component for a UI need, and also when designing layouts, spacing, visual hierarchy, or interaction states, writing interface copy, or making application architecture, state-ownership, or public API decisions.
How do I install gpui-component?
Run npx skills add https://github.com/longbridge/gpui-kit --skill gpui-component in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/gpui-component/ (personal) or .claude/skills/gpui-component/ (project).
Which AI agents can use gpui-component?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is gpui-component safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains gpui-component?
It is published by longbridge in longbridge/gpui-kit. It has 298 recorded installs.
More from longbridge/gpui-kit
gpui-kit
longbridge/gpui-kit
How to build desktop applications with GPUI Kit, the Rust framework published as the gpui-kit crate (GPUI plus gpuikit::component, gpuikit::base, gpuikit::assets). Use when setting up a gpui-kit app, choosing or using a component (Button, Input, Select, Dialog, Sheet, Tabs, Sidebar, List, DataTable, Tree, Chart, etc.), handling component state, theming, or window overlays, and for GPUI mechanics: actions and keybindings, async tasks, contexts, custom elements, entities, events, focus, global state, layout and styling, ElementId, and tests including UI integration testing. Holds the normative Coding Guides: read them before any architecture, state-ownership, public API, naming, or testing decision. Pairs with the gpui-kit-design-guides skill for the Design Guides.
gpui-kit-design-guides
longbridge/gpui-kit
The normative Design Guides for GPUI Kit desktop applications. Read in full before designing or changing any screen, layout, spacing, visual hierarchy, color, density, component choice, interaction state, overlay, motion, data-heavy view, or interface copy in a GPUI Kit (gpui-kit / gpui-component) application, and before reviewing UI work for design quality. Also use when asked what the design rules are, or whether a UI decision follows them.
gpui-layout-and-style
longbridge/gpui-kit
Open the skill to read its SKILL.md instructions.
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.