Class: PhlexKit::AccordionContent
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::AccordionContent
- Defined in:
- app/components/phlex_kit/accordion/accordion_content.rb
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ AccordionContent
constructor
A new instance of AccordionContent.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ AccordionContent
Returns a new instance of AccordionContent.
3 |
# File 'app/components/phlex_kit/accordion/accordion_content.rb', line 3 def initialize(**attrs) = (@attrs = attrs) |
Instance Method Details
#view_template ⇒ Object
4 5 6 7 8 |
# File 'app/components/phlex_kit/accordion/accordion_content.rb', line 4 def view_template(&) # role="region" + aria-labelledby → trigger id (wired by the controller # in connect(), which also assigns the ids), per the APG accordion pattern. div(**mix({ class: "pk-accordion-content", role: "region", data: { phlex_kit__accordion_target: "content", state: "closed" }, style: "height: 0px;", hidden: true }, @attrs), &) end |