Collapsible

A vertically stacked set of interactive headings that each reveal a section of content.

Anatomy

Collapsible do |c|
c.trigger
c.content
end

API Reference

Collapsible

NameTypeDefault
open:booleanfalse
Initial visibility state of the collapsible content. When true, the content will be visible on page load.
attributeskeyword arguments

Collapsible#trigger

NameTypeDefault
as_child:booleanfalse
When true, merges the trigger functionality with the child element instead of wrapping it in a div.
attributeskeyword arguments

Collapsible#content

NameType
attributeskeyword arguments

Keyboard Interactions

KeyDescription
SpaceOpens/closes the collapsible.
EnterOpens/closes the collapsible.

Examples