Class: Daisy::DataDisplay::AccordionComponent
- Inherits:
-
LocoMotion::BaseComponent
- Object
- ViewComponent::Base
- LocoMotion::BaseComponent
- Daisy::DataDisplay::AccordionComponent
- Includes:
- LocoMotion::Concerns::TippableComponent
- Defined in:
- app/components/daisy/data_display/accordion_component.rb
Overview
The Accordion component shows collapsible sections of content, with only one section open at a time. Each section has a title that can be clicked to show or hide its content.
Includes the LocoMotion::Concerns::TippableComponent module to enable easy tooltip addition.
Defined Under Namespace
Classes: AccordionSectionComponent
Constant Summary
Constants inherited from LocoMotion::BaseComponent
LocoMotion::BaseComponent::EMPTY_PART_IGNORED_TAGS, LocoMotion::BaseComponent::SELF_CLOSING_TAGS
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
The name attribute for all radio buttons in this accordion.
Attributes inherited from LocoMotion::BaseComponent
Instance Method Summary collapse
- #before_render ⇒ Object
-
#initialize(**kws, &block) ⇒ AccordionComponent
constructor
Creates a new accordion component.
Methods inherited from LocoMotion::BaseComponent
build, #component_ref, #config_option, #cssify, define_modifier, define_modifiers, define_part, define_parts, define_size, define_sizes, #empty_part_content, #inspect, #part, register_component_initializer, register_component_setup, #rendered_css, #rendered_data, #rendered_html, #rendered_stimulus_controllers, #rendered_tag_name, renders_many, renders_one, set_component_name, #set_loco_parent, #strip_spaces
Constructor Details
#initialize(**kws, &block) ⇒ AccordionComponent
Creates a new accordion component.
157 158 159 160 161 |
# File 'app/components/daisy/data_display/accordion_component.rb', line 157 def initialize(**kws, &block) super @name = config_option(:name, "accordion-#{SecureRandom.uuid}") end |
Instance Attribute Details
#name ⇒ String (readonly)
Returns The name attribute for all radio buttons in this accordion.
140 141 142 |
# File 'app/components/daisy/data_display/accordion_component.rb', line 140 def name @name end |
Instance Method Details
#before_render ⇒ Object
163 164 165 |
# File 'app/components/daisy/data_display/accordion_component.rb', line 163 def before_render super end |