if (interactive()) {
library(shiny)
activator <- function(disabled = FALSE) {
tags$button(
"Enroll", class = activatorClass, onclick = accordionEnrollOnClick(),
disabled = if (isTRUE(disabled)) NA else NULL
)
}
ui <- fluidPage(
tags$head(tags$style(
".acc-header, .acc-content {border: 1px solid; border-radius: 5px;}"
)),
accordion(
"acc",
accordionItem(
"first", div("Hello", activator(TRUE)), "There",
enroll_callback = FALSE, active = TRUE
),
accordionItem(
"second", div("General", activator(FALSE)), "Kenobi",
enroll_callback = FALSE
)
)
)
server <- function(input, output, session) {}
shinyApp(ui, server)
}
Run the code above in your browser using DataLab