Class: UI::AccordionContent
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- UI::AccordionContent
- Includes:
- AccordionContentBehavior
- Defined in:
- app/components/ui/accordion_content.rb
Overview
Accordion Content component (Phlex) Collapsible content area within an accordion item
Instance Method Summary collapse
-
#initialize(item_value: nil, initial_open: false, classes: "", attributes: {}) ⇒ AccordionContent
constructor
A new instance of AccordionContent.
- #view_template(&block) ⇒ Object
Methods included from AccordionContentBehavior
#content_base_classes, #content_classes, #content_data_attributes, #content_html_attributes, #content_id, #content_state, #item_value, #merged_content_data_attributes, #trigger_id
Constructor Details
#initialize(item_value: nil, initial_open: false, classes: "", attributes: {}) ⇒ AccordionContent
Returns a new instance of AccordionContent.
17 18 19 20 21 22 23 |
# File 'app/components/ui/accordion_content.rb', line 17 def initialize(item_value: nil, initial_open: false, classes: "", attributes: {}, **) @item_value = item_value @initial_open = initial_open @classes = classes @attributes = attributes super() end |
Instance Method Details
#view_template(&block) ⇒ Object
25 26 27 28 29 |
# File 'app/components/ui/accordion_content.rb', line 25 def view_template(&block) div(**content_html_attributes) do div(class: "pt-0 pb-4", &block) end end |