| bs_collapse {bsplus} | R Documentation |
Collapsible element
Description
This is useful for content that you may wish to be hidden when the page is initialized, but that can be revealed (and subsequently hidden) by clicking a button or a link.
Usage
bs_collapse(id, content = NULL, show = FALSE)
bs_attach_collapse(tag, id_collapse)
Arguments
id |
character, unique id for the collapsible |
content |
character (HTML) or
|
show |
logical, indicates if collapsible |
tag |
|
id_collapse |
character, |
Details
There are two parts to this system:
A collapsible
<div/>, created usingbs_collapse()At least one button (
<button/>) or link (<a/>) to which theidof the collapsible<div/>is attached, usingbs_attach_collapse()
The verb attach is used to signify that we are attaching the
id of our collapsible
<div/> to the tag in question (a button or a link).
Note that you can attach the id of a collapsible
<div/> to more than one button or link.
It is your responsibility to ensure that id is unique
among HTML elements in your page. If you have non-unique id's,
strange things may happen to your page.
Value
bs_collapse()htmltools::[tag][htmltools::tag],<div/>bs_attach_collapse()htmltools::[tag][htmltools::tag], modified copy oftag(button or link)
See Also
https://getbootstrap.com/docs/3.3/javascript/#collapse
Examples
library("htmltools")
bs_collapse(id = "id_yeah", "Yeah Yeah Yeah")
bs_button("She Loves You", button_type = "primary") %>%
bs_attach_collapse("id_yeah")