Class: PhlexKit::ContextMenuShortcut
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::ContextMenuShortcut
- Defined in:
- app/components/phlex_kit/context_menu/context_menu_shortcut.rb
Overview
Right-aligned keyboard hint on a ContextMenuItem, mirroring shadcn/ui's
ContextMenuShortcut (the item's shortcut: param renders the same span).
See context_menu.rb.
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ ContextMenuShortcut
constructor
A new instance of ContextMenuShortcut.
- #view_template(&block) ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ ContextMenuShortcut
Returns a new instance of ContextMenuShortcut.
6 |
# File 'app/components/phlex_kit/context_menu/context_menu_shortcut.rb', line 6 def initialize(**attrs) = (@attrs = attrs) |
Instance Method Details
#view_template(&block) ⇒ Object
7 8 9 |
# File 'app/components/phlex_kit/context_menu/context_menu_shortcut.rb', line 7 def view_template(&block) span(**mix({ class: "pk-context-menu-shortcut" }, @attrs), &block) end |