Create a F7 toggle switch
f7Toggle(inputId, label, checked = FALSE, color = NULL)
inputId | Toggle input id. |
---|---|
label | Toggle label. |
checked | Whether to check the toggle. FALSE by default. |
color | Toggle color: NULL or "red", "green", "blue", "pink", "yellow", "orange", "grey" and "black". |
if(interactive()){ library(shiny) library(shinyMobile) shinyApp( ui = f7Page( title = "My app", f7SingleLayout( navbar = f7Navbar(title = "f7Toggle"), f7Toggle( inputId = "toggle", label = "My toggle", color = "pink", checked = TRUE ), verbatimTextOutput("test"), f7Toggle( inputId = "toggle2", label = "My toggle 2" ), verbatimTextOutput("test2") ) ), server = function(input, output) { output$test <- renderPrint(input$toggle) output$test2 <- renderPrint(input$toggle2) } ) }