Class: SubAccordionComponent

Inherits:
Component show all
Defined in:
app/components/sub_accordion_component.rb

Overview

SubAccordion — bare nested accordion wrapper.

Renders

without the "ui" prefix or Stimulus controller, for use inside an AccordionItem's content slot.

Usage:

AccordionItem(active: true) { |i|
i.title { "Level 1" }
i.content {
  SubAccordion {
    AccordionItem { |i2|
      i2.title { "Level 1A" }
      i2.content { "Nested content" }
    }
  }
}
}

Constant Summary

Constants inherited from Component

Component::HTML_OPTIONS

Instance Method Summary collapse

Methods inherited from Component

default, #initialize, #render_in, slot

Constructor Details

This class inherits a constructor from Component

Instance Method Details

#to_s ⇒ Object



22
23
24
# File 'app/components/sub_accordion_component.rb', line 22

def to_s
  tag.div(**merge_html_options(class: "accordion")) { @content }
end