Class: Protos::Accordion
- Defined in:
- lib/protos/accordion.rb,
lib/protos/accordion/item.rb
Defined Under Namespace
Classes: Item
Instance Method Summary collapse
- #content ⇒ Object
- #item(input_id: nil) ⇒ Object
- #title ⇒ Object
-
#view_template ⇒ Object
DOCS: The accordion component.
Methods inherited from Component
Constructor Details
This class inherits a constructor from Protos::Component
Instance Method Details
#content ⇒ Object
20 |
# File 'lib/protos/accordion.rb', line 20 def content(...) = render Collapse::Content.new(...) |
#item(input_id: nil) ⇒ Object
14 15 16 17 18 |
# File 'lib/protos/accordion.rb', line 14 def item(*, input_id: nil, **, &) self.current_input_id = input_id render Item.new(*, input_id: current_input_id, **, &) end |
#title ⇒ Object
22 23 24 |
# File 'lib/protos/accordion.rb', line 22 def title(*, **, &) render Collapse::Title.new(*, input_id: current_input_id, **, &) end |
#view_template ⇒ Object
DOCS: The accordion component. Accordion is a collapse with radio buttons. Only one item can be open at a time. If you want to allow multiple items to be open at the same time, use the collapse component. daisyui.com/components/accordion/
10 11 12 |
# File 'lib/protos/accordion.rb', line 10 def view_template(&) ul(**attrs, &) end |