gpui-action

Define GPUI actions and bind keyboard shortcuts with cx.bind_keys().

62|1|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/zerx-lab/rmx --skill gpui-action
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gpui-action
Source: https://github.com/zerx-lab/rmx/tree/main/.opencode/skills/gpui-action
Command: npx skills add https://github.com/zerx-lab/rmx --skill gpui-action

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

GPUI action definitions and keyboard shortcuts provide a unified approach to declare actions and bind keys, enabling consistent, accessible, and keyboard-driven interfaces across GPUI components.

Core Features & Use Cases

  • Declarative actions via actions! macro or derive(Action)
  • Context-aware key bindings with cx.bind_keys()
  • Per-element action handlers via .on_action() and focus-based routing
  • Use Case: Build a text editor-like GPUI app with global shortcuts and contextual bindings

Quick Start

Define actions with actions! macro in your component, bind keys to those actions using KeyBinding, and implement on_action handlers to respond to input. For example, bind "up" and "down" to navigation actions within a context and implement corresponding handlers.

Frequently Asked Questions about gpui-action

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up keyboard bindings in a GPUI application?

To set up keyboard bindings in a GPUI application, use cx.bind_keys() to map keys to actions and implement .on_action() handlers to respond to input within a defined context.

What is the best way to declare actions in a Rust GPUI component?

The best way to declare actions in a Rust GPUI component is using the actions! macro or deriving Action, simplifying wiring actions to keyboard bindings for consistent interfaces.

How does focus-based routing work for GPUI on_action handlers?

Focus-based routing for GPUI on_action handlers directs contextual keyboard shortcuts to the active element, ensuring per-element action handlers respond only to relevant input.

Can I build a text editor-like interface with contextual keyboard shortcuts in GPUI?

Yes, you can build a text editor-like GPUI app with global shortcuts and contextual bindings by defining actions with the actions! macro and binding keys using cx.bind_keys().

Do I need Rust to use derive(Action) and KeyBinding types for UI contexts?

Yes, you need Rust to use derive(Action) and KeyBinding types, as the solution relies on Rust-based GPUI patterns requiring the actions macro and on_action handlers to operate.