Class: PhlexKit::ContextMenuShortcut

Inherits:
BaseComponent show all
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

Methods inherited from BaseComponent

#on

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