Class: UI::Menubar
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- UI::Menubar
- Includes:
- MenubarBehavior
- Defined in:
- app/components/ui/menubar.rb
Overview
Menubar - Phlex implementation
Container for horizontal menu bar with Stimulus controller for interactivity. Uses MenubarBehavior concern for shared styling logic.
Instance Method Summary collapse
-
#initialize(loop: false, aria_label: nil, classes: "", **attributes) ⇒ Menubar
constructor
A new instance of Menubar.
- #view_template(&block) ⇒ Object
Methods included from MenubarBehavior
#menubar_classes, #menubar_data_attributes, #menubar_html_attributes
Constructor Details
#initialize(loop: false, aria_label: nil, classes: "", **attributes) ⇒ Menubar
Returns a new instance of Menubar.
24 25 26 27 28 29 |
# File 'app/components/ui/menubar.rb', line 24 def initialize(loop: false, aria_label: nil, classes: "", **attributes) @loop = loop @aria_label = aria_label @classes = classes @attributes = attributes end |
Instance Method Details
#view_template(&block) ⇒ Object
31 32 33 34 35 |
# File 'app/components/ui/menubar.rb', line 31 def view_template(&block) div(**.deep_merge(@attributes)) do yield if block_given? end end |