Class: PhlexUI::Accordion::Trigger

Inherits:
Base
  • Object
show all
Defined in:
lib/phlex_ui/accordion/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



9
10
11
12
13
14
# File 'lib/phlex_ui/accordion/trigger.rb', line 9

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_templateObject



5
6
7
# File 'lib/phlex_ui/accordion/trigger.rb', line 5

def view_template(&)
  button(**attrs, &)
end