Class: PhlexKit::DropdownMenuShortcut

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/phlex_kit/dropdown_menu/dropdown_menu_shortcut.rb

Overview

Right-aligned keyboard hint in a menu row. Ported from shadcn/ui's DropdownMenuShortcut. See dropdown_menu.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ DropdownMenuShortcut

Returns a new instance of DropdownMenuShortcut.



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

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

Instance Method Details

#view_templateObject



6
7
8
# File 'app/components/phlex_kit/dropdown_menu/dropdown_menu_shortcut.rb', line 6

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