gpui-actions

Implements type-safe action-based event handling in GPUI applications with the actions! macro.

27|3|Updated Jan 11, 2026
One-click install
npx skills add https://github.com/cnwzhu/gpui-skills --skill gpui-actions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gpui-actions
Source: https://github.com/cnwzhu/gpui-skills/tree/main/gpui-actions
Command: npx skills add https://github.com/cnwzhu/gpui-skills --skill gpui-actions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

GPUI Actions provides a structured way to implement user interactions and event-driven behavior in GPUI applications, replacing ad-hoc event handling with a type-safe, scalable approach.

Core Features & Use Cases

  • Type-safe event handling using the Action trait and actions! macro.
  • Keyboard shortcuts and action dispatch for consistent UX.
  • Mouse and focus events (on_click, on_mouse_down, on_focus, on_blur) for interactive UIs.
  • Reusable patterns for building responsive components that react to user input.
  • Use Case: Build a toolbar with Save and Open actions that respond to keyboard shortcuts and update state across windows.

Quick Start

Run gpui-actions within your GPUI project, define actions with the actions! macro, bind handlers with on_action or cx.listener, and trigger updates via cx.notify() or dispatch_action.

Frequently Asked Questions about gpui-actions

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

FAQPage Schema
How do I handle keyboard shortcuts and mouse events in GPUI?

You implement keyboard shortcuts and mouse events in GPUI by defining actions with the actions! macro and binding them via on_click or on_action handlers to dispatch updates.

What is type-safe action dispatch in GPUI?

Type-safe action dispatch in GPUI is a structured event handling pattern using the Action trait to replace ad-hoc logic, enabling scalable and consistent UX across components.

How do I manage focus events for interactive UI components in GPUI?

Focus events for interactive UI components in GPUI are managed using built-in focus workflows like on_focus and on_blur, combined with action dispatch to trigger state updates via cx.notify().

Can I build a toolbar with Save and Open actions that respond to keyboard shortcuts in GPUI?

Yes, you can build a toolbar with Save and Open actions in GPUI by defining actions with the actions! macro, binding them to keyboard shortcuts, and dispatching state updates across windows using cx.notify().

Do I need the gpui crate to implement on_click and focus management workflows?

Yes, implementing on_click and focus management workflows requires the gpui crate and standard Rust tooling to compose type-safe, event-driven interactive applications.