## Only run examples in interactive R sessions
if (interactive()) {
# Examples in the gallery :
shinyWidgets::shinyWidgetsGallery()
# Basic usage :
ui <- fluidPage(
switchInput(inputId = "somevalue"),
verbatimTextOutput("value")
)
server <- function(input, output) {
output$value <- renderPrint({ input$somevalue })
}
shinyApp(ui, server)
}
Run the code above in your browser using DataLab