Learn more at https://getbootstrap.com/docs/5.1/components/accordion/.
bs_accordion(
id,
items = list(),
expand = c(),
button_background_color = NULL,
button_text_color = NULL,
accordion_attr = list(class = "accordion"),
item_attr = list(class = "accordion-item"),
item_header_attr = list(class = "accordion-header"),
button_attr = list(class = "accordion-button collapsed"),
div_attr = list(class = "accordion-collapse collapse"),
body_attr = list(class = "accordion-body")
)
A string of HTML.
A string, the id to use for the accordion, must be unique within a page (if you have multiple accordions on a page).
A named list, names become the label for each panel, values should be the HTML content to display when the panel is toggled.
A vector, the names or positions of panels that should be expanded by default.
A string vector, the color to apply to the background of the accordion toggle button. Recycles for each panel.
A string vector, the color to apply to the text of the accordion toggle button. Recycles for each panel.
A named list or named vector, names are attribute names and values are attribute values. Added to the div wrapping the accordion content.
A named list or named vector, names are attribute names and values are attribute values. Added to the div wrapping the accordion items.
A named list or named vector, names are attribute names and values are attribute values. Added to the accordion panel headers.
A named list or named vector, names are attribute names and values are attribute values. Added to the accordion panel header button items.
A named list or named vector, names are attribute names and values are attribute values. Added to the div wrapping the accordion panel content.
A named list or named vector, names are attribute names and values are attribute values. Added to the div wrapping the accordion panel content body.
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