Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
gpui-ui-kit
A reusable UI component library for GPUI applications.
Provides composable, styled UI components with consistent theming for building desktop applications with the GPUI framework.
Showcase
First app built with gpui-ui-kit is SotF.

Installation
Add to your Cargo.toml:
[]
= { = "0.1.17", ="https://github.com/pierreaubert/sotf/gpui-ui-kit" }
Components
Core Components
| Component | Description |
|---|---|
Button |
Styled button with variants (Primary, Secondary, Destructive, Ghost, Outline) |
IconButton |
Icon-only button with hover states |
Card |
Container with optional header, content, and footer sections |
Dialog |
Modal dialog with backdrop, title, and customizable size |
Menu / MenuBar |
Navigation menus and menu bars |
Tabs |
Tabbed navigation with Underline, Enclosed, and Pills variants |
Toast / ToastContainer |
Notification toasts with positioning |
Form Components
| Component | Description |
|---|---|
Input |
Text input with label, placeholder, validation, mouse drag selection, clipboard (Cmd+C/V/X), and Emacs keybindings |
NumberInput |
Numeric input with +/- buttons, min/max bounds, step size, scroll wheel support, and keyboard navigation |
Checkbox |
Checkbox with label and indeterminate state |
Toggle |
Toggle switch |
Select |
Dropdown select with options |
ButtonSet |
Grouped button options for single selection |
ColorPicker |
Color picker with palette and custom color input |
Slider |
Horizontal slider with value display |
Wizard |
Multi-step wizard with navigation and step validation |
Data Display
| Component | Description |
|---|---|
Badge / BadgeDot |
Status badges with variants |
Progress / CircularProgress |
Progress bars and circular indicators |
Spinner / LoadingDots |
Loading indicators |
Avatar / AvatarGroup |
User avatars with status indicators |
Text / Heading / Code / Link |
Typography components |
Feedback
| Component | Description |
|---|---|
Alert / InlineAlert |
Contextual feedback messages (Info, Success, Warning, Error) |
Tooltip |
Hover tooltips with placement options |
Layout
| Component | Description |
|---|---|
VStack / HStack |
Vertical and horizontal stack layouts |
Spacer |
Flexible spacer element |
Divider |
Horizontal/vertical dividers with optional interactivity |
PaneDivider |
Resizable pane divider for split views |
Accordion |
Collapsible content panels |
Breadcrumbs |
Navigation breadcrumbs |
Audio Controls
| Component | Description |
|---|---|
Potentiometer |
Rotary knob control with customizable range and visual feedback |
VerticalSlider |
Vertical slider with ticks and value display |
VolumeKnob |
Specialized volume control with mute state and dB display |
Usage Examples
Button
use ;
// Basic button
new
// Primary button with click handler
new
.variant
.on_click
// Destructive button
new
.variant
.size
// Ghost button with icon
new
.variant
.icon_left
// Full width disabled button
new
.full_width
.disabled
Card
use Card;
use div;
new
.header
.content
.footer
Input
use ;
// Basic input with label
new
.label
.placeholder
// Input with error
new
.label
.value
.error
// Filled variant with icon
new
.variant
.placeholder
.icon_left
// Input with change callback
new
.label
.on_change
Input Features:
- Mouse drag selection: Click and drag to select text ranges
- Double-click: Select all text
- Clipboard: Cmd+C (copy), Cmd+V (paste), Cmd+X (cut), Cmd+A (select all)
- Emacs keybindings: Ctrl+A (beginning), Ctrl+E (end), Ctrl+K (kill to end), Ctrl+U (kill to beginning)
- Navigation: Arrow keys, Home/End, Backspace/Delete
NumberInput
use ;
// Basic number input
new
.label
.value
.min
.max
.step
// Number input with decimals and units
new
.label
.value
.min
.max
.step
.decimals
.unit
.width
.on_change
// Compact size for dense layouts
new
.value
.min
.max
.step
.decimals
.unit
.size
NumberInput Features:
- +/- buttons: Click to increment/decrement by step size
- Click to edit: Click the value to enter edit mode
- Double-click: Select all text in edit mode
- Scroll wheel: Scroll up/down to adjust value
- Arrow keys: Up/Down to adjust value when focused
- Bounds enforcement: Values clamped to min/max range
Tabs
use ;
new
.tabs
.selected_index
.variant
.on_change
Dialog
use ;
use div;
new
.title
.size
.content
.footer
.on_close
Alert
use ;
// Full alert with title
new
.title
.variant
.closeable
.on_close
// Inline alert
new
.variant
Stack Layouts
use ;
// Vertical stack
new
.spacing
.align
.child
.child
.child
.child
// Horizontal stack with divider
new
.spacing
.child
.child
.child
Progress
use ;
// Linear progress bar
new
.variant
.size
.show_label
// Circular progress
new
.size
.variant
.show_label
Checkbox and Toggle
use ;
// Checkbox with label
new
.label
.checked
.on_change
// Toggle switch
new
.label
.checked
.size
Select
use ;
new
.label
.placeholder
.options
.selected
.on_change
Avatar
use ;
// Single avatar with status
new
.initials
.size
.status
// Avatar group
new
.avatars
.max_visible
Tooltip
use ;
// Wrap any element with a tooltip
new
Accordion
use ;
use div;
new
.mode
.items
ButtonSet
use ;
new
.options
.selected
.size
.on_change
Potentiometer
use ;
// Basic rotary knob
new
.value
.min
.max
.size
.on_change
// With label and units
new
.label
.value
.min
.max
.unit
VerticalSlider
use ;
new
.value
.min
.max
.height
.show_ticks
.on_change
VolumeKnob
use ;
new
.value
.muted
.size
.on_change
.on_mute_toggle
Wizard
use ;
use div;
new
.steps
.current_step
.on_next
.on_back
Theming
Components use a default dark theme. Button theme can be customized:
use ;
use rgb;
let custom_theme = ButtonTheme ;
new
.theme
Design Patterns
Builder Pattern
All components use the builder pattern for configuration:
new
.optional_setting
.another_setting
// Either render directly or build for additional handlers
Event Handlers
Components that support interaction accept closures:
new
.on_click
new
.on_change
Using with GPUI Listeners
For components that need cx.listener(), use the build() method:
new
.build
.on_click
Testing
The library includes a comprehensive test suite to prevent regressions:
# Run all tests
# Run specific test suite
# Setup git hooks for automatic testing
Test Coverage:
- ✅ Integration Tests (237 tests): Comprehensive UI component tests including mouse actions, button clicks, keyboard navigation, and visual rendering
- ✅ Interaction Tests (37 tests): Verify all stateful components support mouse and keyboard events
- ✅ Component Tests (15 tests): Ensure component APIs work correctly and configurations are valid
- ✅ I18n Tests (11 tests): Verify all translations exist across 5 languages (English, French, German, Spanish, Japanese)
- ✅ Library Tests (10 tests): Verify MiniApp configuration and utilities
- ✅ 310 total tests covering critical functionality
See TESTING.md for detailed testing guide and tests/README.md for quick reference.
Development
Running the Showcase
The showcase demonstrates all components with:
- Interactive examples for each component
- Theme switching (Light/Dark)
- Language switching (5 languages)
- Navigation sidebar
Before Committing
# Format code
# Run tests
# Run clippy
Or setup git hooks to run automatically:
Examples
A showcase is provided that demonstrate the capabilities of the library. Here are few examples:
| Buttons | Fonts |
|---|---|
![]() |
![]() |
| Badges | Avatars |
![]() |
![]() |
| Inputs | Progress |
![]() |
![]() |
| Alerts | |
![]() |
![]() |
| Tabs | Layouts |
![]() |
![]() |
| Menus | Potentiometers |
![]() |
![]() |
| Wizard | Workflow |
![]() |
![]() |
License
Permissive ISC License













