In accordion you may display a list of elements that can be hidden or shown with one click.
accordion(
accordion_list,
fluid = TRUE,
active_title = "",
styled = TRUE,
custom_style = ""
)
list with lists with fields: `title` and `content`
if accordion is fluid then it takes width of parent div
if active title matches `title` from accordion_list
then this element is active by default
if switched of then raw style (no boxes) is used
character with custom style added to CSS of accordion (advanced use)
shiny tag list with accordion UI
# NOT RUN {
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) {}
)
}
# }
Run the code above in your browser using DataLab