bs_collapse {bsTools}R Documentation

Create a Bootstrap collapse

Description

Learn more at https://getbootstrap.com/docs/5.1/components/collapse/.

Usage

bs_collapse(
  id,
  button_label,
  content,
  button_attr = c(class = "btn btn-primary"),
  content_attr = c(class = "collapse")
)

Arguments

id

A string, the id to use for the collapse div.

button_label

A string, the text to display in the button controlling the collapsible content.

content

A string, the HTML to display or collapse.

button_attr

A named list or named vector, names are attribute names and values are attribute values. Added to the button controlling the collapse.

content_attr

A named list or named vector, names are attribute names and values are attribute values. Added to the div wrapping the collapsible content.

Value

A string of HTML.

Examples

bs_collapse(
id = "collapse1",
button_label = "Click to Expand",
content = p("Hello")
)

[Package bsTools version 1.0.5 Index]