跳到正文
cccskills
免费在 GitHub 公开

gpui-component

Build GPUI interfaces with gpui-component by choosing suitable controls, handling component state and themes, and following its design and coding guides. The references also cover layout, interaction states, interface copy, and application structure.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

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.

feigeCode/navop星标 1,941(GitHub 1,941 + cccskills 0)

实测评分 未实测

查看安装方法

适用场景

  • Choosing a component for a UI need
  • Setting up gpui-component in a GPUI app
  • Handling component state and theming
  • Reviewing layout and interaction states
  • Making state ownership or public API decisions

包含的文件(5)

  • SKILL.md8.5 KB
  • references/coding-guides.md40.0 KB
  • references/design-guides.md46.0 KB
  • references/style-guide.md9.3 KB
  • references/usage.md10.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Read This First

Before changing UI, interaction, interface language, layout, styling, components, or application architecture, read the relevant guide:

GuideRead before
Design GuidesChoosing components, layout, spacing, hierarchy, color, density, interaction states, overlays, interface copy
Coding GuidesCrate 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.
  • Button vs Link. Button for every in-app command — use ghost or outline when it should read quietly. Link only for external URLs and email addresses.
  • Tokens before values. No raw hex or rgb(...) in application UI; use cx.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 a Delete button, not Are you sure? with OK.

Documentation

  • Full reference: fetch https://longbridge.github.io/gpui-component/llms-full.txt
  • Per-component API: fetch https://longbridge.github.io/gpui-component/docs/components/{name}.md
    • e.g. button.md, input.md, select.md, dialog.md, data-table.md
  • Any site page can be fetched as Markdown by appending .md to 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

ComponentImportNotes
Inputinput::{Input, InputState}Stateful. Text, password, mask, validation
NumberInputinput::{NumberInput, NumberInputEvent}Stateful. Numeric with step
OtpInputinput::OtpInputStateful. One-time password
Selectselect::{Select, SelectState}Stateful. Dropdown picker
Comboboxcombobox::{Combobox, ComboboxState}Stateful. Searchable select
Checkboxcheckbox::CheckboxStateless. `on_click(
Switchswitch::SwitchStateless. Toggle
Radioradio::{Radio, RadioGroup}Stateless.
Sliderslider::{Slider, SliderState}Stateful.
Togglebutton::ToggleStateless.
Ratingrating::RatingStateless.
Stepperstepper::StepperStateless. Increment/decrement
ColorPickercolor_picker::{ColorPicker, ColorPickerState}Stateful.
DatePickerdate_picker::{DatePicker, DatePickerState}Stateful.
Formform::{v_form, h_form, field}Layout container for form fields

Display & Feedback

ComponentImportNotes
Buttonbutton::{Button, ButtonGroup}Stateless. Primary UI action
Icon{Icon, IconName}Stateless. Lucide icons
Badgebadge::BadgeStateless.
Tagtag::TagStateless. Closable tags
Avataravatar::AvatarStateless.
Labellabel::LabelStateless. Form label
Kbdkbd::KbdStateless. Keyboard key display
Alertalert::AlertStateless. Info/success/warning/error
Spinnerspinner::SpinnerStateless. Loading indicator
Skeletonskeleton::SkeletonStateless. Loading placeholder
Progressprogress::{Progress, ProgressCircle}Stateless.
Tooltiptooltip::TooltipVia .tooltip() on elements
HoverCardhover_card::{HoverCard, HoverCardState}Stateful.
Clipboardclipboard::ClipboardStateless. Copy button

Overlay & Popups

ComponentImportNotes
Dialogdialog::Dialog + WindowExtVia window.open_dialog(...)
AlertDialogWindowExtVia window.open_alert_dialog(...)
Sheetsheet::Sheet + WindowExtSide panel, via window.open_sheet(...)
Notificationnotification::Notification + WindowExtVia window.push_notification(...)
Popoverpopover::PopoverFloating overlay
Menumenu::{PopupMenu, DropdownMenu}Context menus
DropdownButtonbutton::DropdownButtonButton with dropdown menu

Navigation & Layout

ComponentImportNotes
Tabs / TabBartab::{Tab, TabBar}Tabbed interface
Sidebarsidebar::{Sidebar, SidebarMenu, ...}App navigation panel
TitleBarTitleBarWindow title bar
Breadcrumbbreadcrumb::BreadcrumbNavigation breadcrumb
Paginationpagination::PaginationPage navigation
Accordionaccordion::AccordionCollapsible sections
Collapsiblecollapsible::CollapsibleSingle collapsible
GroupBoxgroup_box::GroupBoxLabeled container
Resizableresizable::{h_resizable, v_resizable, resizable_panel, ResizableState}Draggable split panes
Scrollablescroll::ScrollbarCustom scrollbar
FocusTrapgpui_base::focus_trap::FocusTrapElementKeyboard trap for modals

Data Display

ComponentImportNotes
DataTabletable::{DataTable, TableState, TableDelegate}Stateful. Full-featured table
Tabletable::{Table, ...}Simpler table
VirtualList{v_virtual_list, h_virtual_list}High-perf large lists
Listlist::{List, ListState, ListDelegate}Stateful. Searchable list
Treetree::{Tree, TreeState, TreeItem, TreeEntry}Stateful. Hierarchy
DescriptionListdescription_list::DescriptionListKey-value pairs
Settingssetting::SettingsSettings panel

Charts

ComponentImportNotes
Chartchart::{AreaChart, BarChart, LineChart, PieChart, RadarChart}Bar, line, area, pie charts
Plotplot::Plot#[derive(IntoPlot)] for data

Reference Files

  • usage.md — setup patterns, component types, common examples
  • style-guide.md — code style for contributors

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Implement and debug onetcli connection importers packaged as WebAssembly components. The skill covers parsing application settings, manifests and packaging, host integration, local visibility, password handling, and import preview issues.

中文简介正在准备中。当前显示英语简介。

  • Adding an importer for a database application
  • Debugging a WASM importer that is not listed
  • Packaging and installing a composite extension
feigeCode/navop19412026年10月26日 更新

gpui

免费

Use this skill while building or maintaining GPUI applications. It provides focused references for framework APIs and patterns, including keybindings, async tasks, state, events, layout, focus, custom elements, and tests.

中文简介正在准备中。当前显示英语简介。

  • Finding the right GPUI API for a feature
  • Implementing keyboard actions and focus navigation
  • Managing entities, events, or global state
feigeCode/navop19412026年10月26日 更新

Design, implement, review, or debug onetcli IPC database drivers. Work from the `driver.json` manifest and JSON-RPC protocol contract through schema metadata, SQL-building methods, import and export, tests, and packaging, with guidance that applies across implementation languages.

中文简介正在准备中。当前显示英语简介。

  • Creating or reviewing an onetcli IPC database driver
  • Defining driver.json methods and capabilities
  • Implementing schema metadata and DDL builders
feigeCode/navop19412026年10月26日 更新

navop

免费

Use the Navop CLI to discover and operate resources exposed by a running Navop desktop app. The skill checks live tools, permissions, and schemas before commands, then follows Navop’s approval decisions for operations.

中文简介正在准备中。当前显示英语简介。

  • Checking which Navop tools are currently available
  • Inspecting a tool’s live schema before using it
  • Running a supported read or write operation
feigeCode/navop19412026年10月26日 更新

Prepare and review bilingual Chinese and English release notes for Navop. Maintain `CHANGELOG.md` as the source of truth, then check that tagged entries provide consistent content for GitHub Releases and the R2 updater manifest when a release is published or synchronized.

中文简介正在准备中。当前显示英语简介。

  • Drafting bilingual notes for a Navop version
  • Reviewing a CHANGELOG.md release entry
  • Checking release notes before creating a version tag
feigeCode/navop19412026年10月26日 更新

Create GPUI UI components that follow the project’s existing implementation and Shadcn UI styling patterns. Choose a stateless or stateful design, keep the component API consistent with other elements, and add documentation and stories for the new component.

中文简介正在准备中。当前显示英语简介。

  • Building a new GPUI UI element
  • Choosing whether a component needs internal state
  • Matching an existing component API and style
feigeCode/navop19412026年10月26日 更新

查看 feigeCode 的全部技能

报告此技能的问题