Learn R Programming

bsTools (version 0.1.0)

bs_accordion: Create a Bootstrap accordion

Description

Create a Bootstrap accordion

Usage

bs_accordion(
  id,
  items = list(),
  accordion_class = "accordion",
  item_class = "accordion-item",
  item_header_class = "accordion-header",
  button_class = "accordion-button",
  div_class = "accordion-collapse collapse",
  body_class = "accordion-body"
)

Arguments

id

A string, the id to use for the accordion, must be unique within a page (if you have multiple accordions on a page).

items

A named list, names become the label for each panel, values should be the HTML content to display when the panel is toggled.

accordion_class

A string, the class of the div wrapping the accordion content.

item_class

A string, the class of the div wrapping the accordion items.

item_header_class

A string, the class of the accordion panel headers.

button_class

A string, the class of the div wrapping the accordion panel header button items.

div_class

A string, the class of the div wrapping the accordion panel content.

body_class

A string, the class of the div wrapping the accordion panel content body.

Value

A string of HTML.

Examples

Run this code
# NOT RUN {
bs_accordion(
id = "acc1",
items = list(
  "One" = p("Check it out."),
  "Two" = p("Does it work?"),
  "Three" = p("I hope so.")
)
)
# }

Run the code above in your browser using DataLab