Learn R Programming

shinyMobile (version 0.7.0)

f7Accordion: Create a Framework7 accordion

Description

Build a Framework7 accordion

Usage

f7Accordion(..., inputId = NULL, multiCollapse = FALSE)

Arguments

...

Slot for f7AccordionItem.

inputId

Optional id to recover the state of the accordion.

multiCollapse

Whether to open multiple items at the same time. FALSE by default.

Examples

Run this code
# NOT RUN {
if(interactive()){
 library(shiny)
 library(shinyMobile)

 shiny::shinyApp(
  ui = f7Page(
    title = "Accordions",
    f7SingleLayout(
     navbar = f7Navbar("Accordions"),
     f7Accordion(
      inputId = "myaccordion1",
      f7AccordionItem(
       title = "Item 1",
       f7Block("Item 1 content"),
       open = TRUE
      ),
      f7AccordionItem(
       title = "Item 2",
       f7Block("Item 2 content")
      )
     ),
     f7Accordion(
      multiCollapse = TRUE,
      inputId = "myaccordion2",
      f7AccordionItem(
       title = "Item 1",
       f7Block("Item 1 content")
      ),
      f7AccordionItem(
       title = "Item 2",
       f7Block("Item 2 content")
      )
     )
    )
  ),
  server = function(input, output, session) {
   observe({
    print(
     list(
      accordion1 = input$myaccordion1,
      accordion2 = input$myaccordion2
     )
    )
   })
  }
 )
}

# }

Run the code above in your browser using DataLab