Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

accordion

Accordion UI


Description

In accordion you may display a list of elements that can be hidden or shown with one click.

Usage

accordion(
  accordion_list,
  fluid = TRUE,
  active_title = "",
  styled = TRUE,
  custom_style = ""
)

Arguments

accordion_list

list with lists with fields: 'title' and 'content'

fluid

if accordion is fluid then it takes width of parent div

active_title

if active title matches 'title' from accordion_list then this element is active by default

styled

if switched of then raw style (no boxes) is used

custom_style

character with custom style added to CSS of accordion (advanced use)

Value

shiny tag list with accordion UI

Examples

if (interactive()) {
library(shiny)
library(shiny.semantic)
accordion_content <- list(
  list(title = "AA", content = h2("a a a a")),
  list(title = "BB", content = p("b b b b"))
)
shinyApp(
  ui = semanticPage(
    accordion(accordion_content, fluid = F, active_title = "AA",
              custom_style = "background: #babade;")
  ),
  server = function(input, output) {}
)
}

shiny.semantic

Semantic UI Support for Shiny

v0.4.2
MIT + file LICENSE
Authors
Filip Stachura [aut], Dominik Krzeminski [cre], Krystian Igras [aut], Adam Forys [aut], Paweł Przytuła [aut], Jakub Chojna [aut], Olga Mierzwa-Sulima [aut], Ashley Baldry [ctb], Jakub Chojna [ctb], Olga Mierzwa-Sulima [ctb], Pedro Manuel Coutinho da Silva [ctb], Paweł Przytuła [ctb], Kamil Żyła [ctb], Rabii Bouhestine [ctb], Appsilon Sp. z o.o. [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.