Class: PhlexKit::MenubarShortcut
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::MenubarShortcut
- 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
-
#initialize(**attrs) ⇒ MenubarShortcut
constructor
A new instance of MenubarShortcut.
- #view_template(&block) ⇒ Object
Methods inherited from BaseComponent
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 |