Learn R Programming

shinyMobile (version 0.7.0)

f7Toggle: Create a F7 toggle switch

Description

Create a F7 toggle switch

Usage

f7Toggle(inputId, label, checked = FALSE, color = NULL)

Arguments

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".

Examples

Run this code
# NOT RUN {
if(interactive()){
 library(shiny)
 library(shinyMobile)

 shiny::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)
   }
 )
}
# }

Run the code above in your browser using DataLab