Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
longbridge avatar

Gpui

  • 138 installs
  • 12.4k repo stars
  • Updated August 4, 2026
  • longbridge/gpui-component

Wire keyboard shortcuts and declarative actions in a GPUI (Rust) desktop UI without ad-hoc event handling.

About

The gpui skill packages procedural knowledge for GPUI’s actions and keybindings system—how solo and indie builders declare keyboard-driven UI behavior in Rust desktop apps. It walks through defining action types, binding keys at app init, attaching listeners on rendered elements, and scoping shortcuts with key contexts so the same key means different things in different panes. For builders shipping native tooling, editors, or internal utilities on GPUI (longbridge/gpui-component), this reduces trial-and-error around the `actions!` macro, `KeyBinding::new`, and the listener pattern compared to reading scattered framework docs. Use when you are implementing or refactoring keyboard UX in a GPUI view, not when choosing a UI stack or designing visual layout. It is reference-grade implementation guidance aligned with declarative GPUI patterns rather than a full application scaffold.

  • Defines actions via `actions!` macro or `#[derive(Action)]` and registers bindings with `cx.bind_keys()`
  • Handles input with `.on_action(cx.listener(...))` on elements scoped by `key_context()`
  • Documents key string formats (e.g. `cmd-s`, `up`) and context-aware binding with named contexts like `Editor`
  • Quick-start flow: init bindings in `App`, implement handlers on the view, call `cx.notify()` after state changes

Gpui by the numbers

  • 138 all-time installs (skills.sh)
  • +24 installs in the week ending Aug 2, 2026 (Skillselion tracking)
  • Ranked #60 of 121 Rust skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/longbridge/gpui-component --skill gpui

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs138
repo stars12.4k
Last updatedAugust 4, 2026
Repositorylongbridge/gpui-component

What it does

Wire keyboard shortcuts and declarative actions in a GPUI (Rust) desktop UI without ad-hoc event handling.

Files

SKILL.mdMarkdownGitHub ↗

Navigation

Load the relevant reference file based on the task:

TopicFileWhen to load
Actions & keybindingsaction.mdactions!, bind_keys, on_action, key_context
Async & background tasksasync.mdcx.spawn, background_spawn, Task, async I/O
Context managementcontext.mdApp, Window, Context<T>, AsyncApp
Custom elements (low-level)element.mdElement trait, request_layout, prepaint, paint
Entity stateentity.mdEntity<T>, WeakEntity, state management
Events & subscriptionsevent.mdcx.emit, cx.subscribe, cx.observe
Focus & keyboard navfocus-handle.mdFocusHandle, track_focus, Tab navigation
Global stateglobal.mdGlobal trait, cx.set_global, app-wide config
Layout & stylinglayout-style.mddiv(), h_flex(), v_flex(), flexbox, overflow, positioning
ElementIdelement-id.mdElementId, .id(), uniqueness rules, stateful elements
Testingtest.md#[gpui::test], TestAppContext, VisualTestContext

Extended References

For deep-dive topics, additional reference files are available:

Element trait:

  • element-api.md — complete API, hitbox system, event handling
  • element-patterns.md — text, interactive, container, composite patterns
  • element-examples.md — full examples: text, interactive, complex elements
  • element-best-practices.md — performance, state, common pitfalls
  • element-advanced.md — masonry/circular layouts, async updates, virtual lists

Entity management:

  • entity-api.md — complete Entity API, methods, lifecycle
  • entity-patterns.md — model-view, cross-entity communication, observer
  • entity-best-practices.md — memory, performance, lifecycle
  • entity-advanced.md — collections, registry, debounce, state machines

Testing:

  • test-examples.md — testing examples and patterns
  • test-reference.md — complete testing API reference

Related skills

Rustfrontend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.