Using the Collapse component
I find that the Collapse component's name is a bit confusing. What it really means is a collapsable section that can be shown or hidden on a click action. Let's start by creating a simple collapsable section of text on the index.ejs
template. Open that template and insert the following code wherever you like:
<p><a class="btn btn-primary" data-toggle="collapse" href="#collapse-link" aria-expanded="false">Collapse Link Trigger</a></p>
The Collapse component is broken into two parts. The first is the trigger to show or hide the collapsable content. The second is the actual content you want to show or hide. Let's review it in more detail to show how to code this up:
The first part is the trigger for the collapsable content, and I have chosen to use a link that has some button classes on it
The link requires the
data-toggle
attribute with a value ofcollapse
on itThe
href
for the link needs to be a unique ID name, in this case,#collapse...