Learn R Programming

nextGenShinyApps (version 2.1)

accordion: Generate an accordion

Description

Wrap one or more accordion items into a container

Usage

accordion(..., id, style = c("default", "1", "2", "3", "4"), uncollapsed = 1)

Value

HTML of a container with a class called accordion

Arguments

...

The accordionItem elements to include within the body of the particular accordion

id

The identification of the accordion

style

Style of the accordion, use "default", "1", "2", "3", "4"

uncollapsed

Indicate by number which accordionItem should not be collapsed

Examples

Run this code
# \donttest{
if (interactive()) {
  library(shiny)
  library(nextGenShinyApps)

  shiny::shinyApp(
    ui = fluidPage(
      style = "8",
      custom.bg.color = "white",
      sidebar = NULL,
      header = NULL,
      accordion(
        id = "accordion5",
        style = "2",
        accordionItem(
          title = "Accordion 1",
          icon = shiny::icon("edit"),
          "Massa sed elementum sus"
        ),
        accordionItem(
          title = "Accordion 2",
          icon = shiny::icon("cog"),
          "Auctor neque etiam non."
        )
      )
    ),
    server = function(input, output) {
    }
  )
}
# }

Run the code above in your browser using DataLab