bs_collapse: Create a Bootstrap collapse

View source: R/bsTools2.R

bs_collapseR 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")
)

bsTools documentation built on Aug. 30, 2022, 1:08 a.m.

Related to bs_collapse in bsTools...