if (interactive()){
ui <- shinyUI(
semanticPage(
p("Simple checkbox:"),
checkbox_input("example", "Check me", is_marked = FALSE),
p(),
p("Simple toggle:"),
toggle("tog1", "My Label", TRUE)
)
)
server <- function(input, output, session) {
observeEvent(input$tog1, {
print(input$tog1)
})
}
shinyApp(ui, server)
}
Run the code above in your browser using DataLab