The bs_collapse()
family of functions may not be the
most useful, but it gives us a place to start.
The first step is to create (and publish to the page) a collapsible
element, using the bs_collapse()
function, supplying a
unique id
and some HTML content
.
bs_collapse(
id = "yeah",
content = tags$div(class = "well", "Yeah Yeah Yeah")
)
Next, attach the id
of the collapsible element to a
button or link tag, using the bs_attach_collapse()
function. This returns a modified copy of the tag sent to it.
bs_button("She Loves You", button_type = "primary") %>%
bs_attach_collapse("yeah")
You can attach the id
of a collapsible element to as
many buttons or links as you like:
bs_button("Sie Liebt Dich", button_type = "primary") %>%
bs_attach_collapse("yeah")
For more information, please see the Bootstrap JavaScript page.