New to Claude Skills? Learn how to install them →

longbridge on GitHub

GPUI Component Library

Free

Streamline UI development with GPUI components.

Get this skill

Free · Opens the source repo

What GPUI Component Library does

The GPUI Component Library provides a comprehensive set of UI components designed specifically for GPUI applications. It includes essential elements such as buttons, inputs, dialogs, and navigation components, making it easier for developers to create user interfaces quickly and efficiently. The library supports both stateful and stateless components, allowing for flexible usage depending on the application needs.

To get started, developers must initialize the library with gpui_component::init(cx) in their application’s main function. This setup is crucial as it ensures that the components are ready to be used throughout the application. The library features a variety of components categorized into input forms, display feedback, overlays, navigation, data display, and charts, each with its own API documentation accessible through Markdown files. This structure allows developers to find the right component for their specific UI requirements easily.

The GPUI Component Library is particularly beneficial for those building applications that require a consistent and cohesive user interface. By utilizing the pre-defined components, developers can save time on design and implementation, allowing them to focus on functionality and user experience. The theming capabilities also enable customization of the UI to match the branding or aesthetic preferences of the application.

Overall, the GPUI Component Library is an essential tool for developers looking to enhance their UI development process with a robust set of components tailored for GPUI applications.

When to use it

Use this skill when developing GPUI applications that require consistent UI components and theming.

When not to use it

This skill may not be suitable for applications that do not utilize GPUI or require highly custom UI components outside the provided library.

What you can build with it

Building a Login Form

Use the Input and Button components to create a user-friendly login form with validation.

Creating a Dashboard

Utilize the DataTable and Chart components to display analytics and visual data in a cohesive layout.

Implementing Navigation Menus

Leverage the Sidebar and Tabs components to create an intuitive navigation structure for your application.

How to install GPUI Component Library

View source

1. Install with the skills CLI

npx skills add longbridge/gpui-component/gpui-component --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by longbridge

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
NumberInputnumber_input::{NumberInput, NumberInputState}Stateful. Numeric with step
OtpInputotp_input::{OtpInput, OtpInputState}Stateful. 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.
Toggletoggle::ToggleStateless.
Ratingrating::RatingStateless.
Stepperstepper::StepperStateless. Increment/decrement
ColorPickercolor_picker::{ColorPicker, ColorPickerState}Stateful.
DatePickertime::date_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::{ProgressBar, ProgressCircle}Stateless.
Tooltiptooltip::TooltipVia .tooltip() on elements
HoverCardhover_card::{HoverCard, HoverCardState}Stateful.
Imageimage::ImageStateless.
Clipboardclipboard::ClipboardStateless. Copy button

Overlay & Popups

ComponentImportNotes
Dialogdialog::Dialog + WindowExtVia window.open_modal(...)
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
TitleBartitle_bar::TitleBarWindow title bar
Breadcrumbbreadcrumb::BreadcrumbNavigation breadcrumb
Paginationpagination::PaginationPage navigation
Accordionaccordion::AccordionCollapsible sections
Collapsiblecollapsible::CollapsibleSingle collapsible
GroupBoxgroup_box::GroupBoxLabeled container
Resizableresizable::ResizableDraggable split panes
Scrollablescroll::ScrollbarCustom scrollbar
FocusTrapfocus_trap::FocusTrapKeyboard 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, TreeDelegate}Stateful. Hierarchy
DescriptionListdescription_list::DescriptionListKey-value pairs
Settingssettings::SettingsSettings panel

Charts

ComponentImportNotes
Chartchart::ChartBar, 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

Frequently asked questions about GPUI Component Library

Similar skills