Class: PhlexKit::MenubarShortcut

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

Overview

Right-aligned keyboard hint on a MenubarItem (the item's shortcut: param renders the same span). Mirrors shadcn/ui's MenubarShortcut. See menubar.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ MenubarShortcut

Returns a new instance of MenubarShortcut.



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

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

Instance Method Details

#view_template(&block) ⇒ Object



6
7
8
# File 'app/components/phlex_kit/menubar/menubar_shortcut.rb', line 6

def view_template(&block)
  span(**mix({ class: "pk-menubar-shortcut" }, @attrs), &block)
end