Accordion
The Bootstrap accordion
component, implemented in Ruby. Use it like any other matestack component in your apps, pages and components. It offers customizable options to simply achieve what is possible in bootstrap with this component. See below for more information about the possible options.
bs_accordion(*args, &block)
bs_accordion(*args, &block)
Returns a bootstrap accordion containing card header and collapsable card-body elements or content specified by a block.
Required options
:items
- expects an array with 2 hashes, one forheader
and one forbody
. The two hashes can have the following keysopen
- if true, this item will be shown initiallyheader
:class
&id
- adding custom class and id to header componentsize
- customize heading element, by default it's set ash2
text
- header text block
body
:class
- adding custom class to body componentmulti
- If set true, collapse body can be control by multiple sourcestext
- adding text block to body
Optional options
:open
- if true, all items will be shown initiallyHtml attributes - all w3c confirm html attributes for div's can be set via options and will be added to the surrounding accordion div.
Examples
Example 1: Open specified items initially
Example 1: Open all items initially
Last updated