bs_accordion: Create a Bootstrap accordion

Description Usage Arguments Value Examples

View source: R/bootstrap.R

Description

Create a Bootstrap accordion

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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

1
2
3
4
5
6
7
8
bs_accordion(
id = "acc1",
items = list(
  "One" = p("Check it out."),
  "Two" = p("Does it work?"),
  "Three" = p("I hope so.")
)
)

bsTools documentation built on Feb. 9, 2021, 5:06 p.m.