Skip to contents

f7Accordion creates an interactive accordion container.

f7AccordionItem is to be inserted in f7Accordion.

updateF7Accordion toggles an f7Accordion on the client.

Usage

f7Accordion(
  ...,
  id = NULL,
  multiCollapse = deprecated(),
  side = c("right", "left")
)

f7AccordionItem(..., title = NULL, open = FALSE)

updateF7Accordion(
  id,
  selected = NULL,
  session = shiny::getDefaultReactiveDomain()
)

Arguments

...

Item content such as f7Block or any f7 element.

id

Accordion instance.

multiCollapse

[Deprecated]: removed from Framework7.

side

Accordion collapse toggle side. Default to right.

title

Item title.

open

Whether the item is open at start. FALSE by default.

selected

Index of item to select.

session

Shiny session object

Author

David Granjon, dgranjon@ymail.com

Examples

library(shiny)
library(shinyMobile)

app <- shinyApp(
  ui = f7Page(
    title = "Accordions",
    f7SingleLayout(
      navbar = f7Navbar("Accordions"),
      f7Segment(f7Button(inputId = "go", "Go")),
      f7Accordion(
        id = "myaccordion1",
        f7AccordionItem(
          title = "Item 1",
          f7Block("Item 1 content"),
          open = TRUE
        ),
        f7AccordionItem(
          title = "Item 2",
          f7Block("Item 2 content")
        )
      )
    )
  ),
  server = function(input, output, session) {
    observeEvent(input$go, {
      updateF7Accordion(id = "myaccordion1", selected = 2)
    })
  }
)

if (interactive() || identical(Sys.getenv("TESTTHAT"), "true")) app