Skip to contents

Generates an 'accordion' tab-set that only one tab is expanded at a time. This feature is experimental and has bugs in some situations. Please use it at your own risk.

Usage

accordion(
  ...,
  id = rand_string(prefix = "accordion-"),
  class = NULL,
  style_header = NULL,
  style_body = NULL,
  env = parent.frame(),
  extras = list(),
  root_path = template_root()
)

accordion_operate(
  id,
  itemId,
  item_title,
  method = c("expand", "collapse", "toggle"),
  session = shiny::getDefaultReactiveDomain()
)

Arguments

...

'accordion' items, generated by accordion_item

id

the element id, must be unique

class

the additional 'HTML' class

style_header

additional 'CSS' styles for header

style_body

additional 'CSS' styles for content body

env

environment to evaluate ...

extras

key-value pairs that overrides the parameters in accordion_item

root_path

see template_root

itemId

accordion_item id

item_title

accordion_item title, if item id is specified, this title will be ignored

method

operation, choices are 'expand' (default), 'collapse', or 'toggle'

session

shiny session

Value

'shiny.tag.list' 'HTML' tags

See also

Examples



if(interactive()) {

  library(shiny)
  library(shidashi)

  accordion(
    id = "input-set",
    accordion_item(
      title = "Input Group A",
      textInput("input_1", "Input 1"),
      collapsed = FALSE,
      footer = "Anim pariatur cliche reprehenderit dolor brunch."
    ),
    accordion_item(
      title = "Input Group B",
      textInput("input_2", "Input 2"),
      footer = actionButton("btn1", "OK"),
      collapsed = FALSE
    )
  )
}