Class: UI::AccordionContentComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::AccordionContentComponent
- Includes:
- AccordionContentBehavior
- Defined in:
- app/view_components/ui/accordion_content_component.rb
Overview
Accordion Content component (ViewComponent) Collapsible content area within an accordion item
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(item_value: nil, initial_open: false, classes: "", attributes: {}) ⇒ AccordionContentComponent
constructor
A new instance of AccordionContentComponent.
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: {}) ⇒ AccordionContentComponent
Returns a new instance of AccordionContentComponent.
17 18 19 20 21 22 |
# File 'app/view_components/ui/accordion_content_component.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 end |
Instance Method Details
#call ⇒ Object
24 25 26 27 28 |
# File 'app/view_components/ui/accordion_content_component.rb', line 24 def call content_tag :div, **content_html_attributes do content_tag :div, content, class: "pt-0 pb-4" end end |