Class: PhlexUI::Accordion::DefaultTrigger

Inherits:
Base
  • Object
show all
Defined in:
lib/phlex_ui/accordion/default_trigger.rb

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#before_template, #initialize

Constructor Details

This class inherits a constructor from PhlexUI::Base

Instance Method Details

#default_attrsObject



12
13
14
15
16
17
# File 'lib/phlex_ui/accordion/default_trigger.rb', line 12

def default_attrs
  {
    data: {action: "click->accordion#toggle"},
    class: "w-full flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline"
  }
end

#view_template(&block) ⇒ Object



5
6
7
8
9
10
# File 'lib/phlex_ui/accordion/default_trigger.rb', line 5

def view_template(&block)
  div(class: "flex items-center justify-between w-full") do
    p(&block)
    render ::PhlexUI::Accordion::Icon.new
  end
end