Class: PhlexKit::MenubarTrigger

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

Overview

See menubar.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ MenubarTrigger

Returns a new instance of MenubarTrigger.



4
# File 'app/components/phlex_kit/menubar/menubar_trigger.rb', line 4

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

Instance Method Details

#view_templateObject



5
6
7
8
9
10
11
12
13
# File 'app/components/phlex_kit/menubar/menubar_trigger.rb', line 5

def view_template(&)
  button(**mix({
    type: :button,
    class: "pk-menubar-trigger",
    role: "menuitem",
    aria: { haspopup: "menu", expanded: "false" },
    data: { action: "click->phlex-kit--menubar#toggle mouseenter->phlex-kit--menubar#switch" }
  }, @attrs), &)
end