Accordion

Description

Create a stack of collapsible sections.

Usage

bc_accordion(..., id = NULL, multiple = FALSE, class = NULL)

bc_accordion_item(
  title,
  ...,
  open = FALSE,
  disabled = FALSE,
  id = NULL,
  icon = NULL
)

Arguments

Argument Description
... For bc_accordion(), items from bc_accordion_item(). A list is passed to bc_accordion_item() as its arguments. For bc_accordion_item(), the item's content.
id String. The ID. bc_accordion() uses a random ID by default. With bc_shiny_deps(), input$id is the IDs, or titles, of the open items when bc_accordion() is given an id.
multiple Bool. Allow more than one item open at a time. Defaults to FALSE, so opening one item closes the others.
class String. Extra CSS classes.
title String. The item's title, always visible.
open Bool. Whether the item starts open. Defaults to FALSE.
disabled Bool. Lock the item open or closed. Defaults to FALSE.
icon Tag. An icon to replace the default caret, such as one from the phosphoricons package.

Value

An htmltools tag.

Examples

bc_accordion(
  bc_accordion_item("First section", "First section content.", open = TRUE),
  bc_accordion_item("Second section", "Second section content.")
)
First section
First section content.
Second section
Second section content.