Collapse
The Bootstrap collapse
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_collapse(*args, &block)
bs_collapse(*args, &block)
Returns a bootstrap collapse containing text or content specified by a block. Also the collapse is customizable with the following options.
Optional options
card
- can be 2 types of option depends on the argument it has been given. you can pass on a String or a hash with customclass
andtext
multi
- If set true, collapse element can show and hide by multiple sourcesparent
- Set data attribute data-bs-parentlabeledby
- Set attribute aria-labelledbyJavascript Triggers:
toggle_on
- Expects an event as string on which the collapse will be showed or hidden:show_on
- Expects an event as string on which the collapse will be showed calling javascriptshow
method.:hide_on
- Expects an event as string on which the collapse will be hidden calling javascripthide
method.:dispose_on
- Expects an event as string on which the collapse will be disposed calling javascriptdispose
method.
Html attributes - all w3c confirm html attributes for div's can be set via options and will be added to the surrounding collapse div.
Examples
Example 1: Basic Collapse component triggered by Matestack Events
returns
Example 2: Basic Collapse component triggered via data attributes
returns
Example 3: Multiple Targets
Last updated