Class: PhlexKit::ShortcutKey

Inherits:
BaseComponent show all
Defined in:
app/components/phlex_kit/shortcut_key/shortcut_key.rb

Overview

Keyboard-shortcut hint, rendered as . Ported from ruby_ui's RubyUI::ShortcutKey. Purely visual — wires no key handler.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ ShortcutKey

Returns a new instance of ShortcutKey.



5
# File 'app/components/phlex_kit/shortcut_key/shortcut_key.rb', line 5

def initialize(**attrs) = (@attrs = attrs)

Instance Method Details

#view_templateObject



7
# File 'app/components/phlex_kit/shortcut_key/shortcut_key.rb', line 7

def view_template(&) = kbd(**mix({ class: "pk-shortcut-key" }, @attrs), &)