Learn R Programming

shinyWidgets (version 0.3.0)

materialSwitch: Material Design Switch Input Control

Description

Create buttons grouped that act like radio buttons.

Usage

materialSwitch(inputId, label = NULL, value = FALSE, status = "default",
  right = FALSE, width = NULL)

Arguments

inputId

The input slot that will be used to access the value.

label

Input label.

value

TRUE or FALSE.

status

Color of the switch

right

Should the the label be on the right ? default to FALSE

width

Width of the container

Value

A switch control that can be added to a UI definition.

Examples

Run this code
# NOT RUN {
materialSwitch(inputId = "somevalue", label = "")
# }
# NOT RUN {
## Only run examples in interactive R sessions
if (interactive()) {

ui <- fluidPage(
  materialSwitch(inputId = "somevalue", label = ""),
  verbatimTextOutput("value")
)
server <- function(input, output) {
  output$value <- renderText({ input$somevalue })
}
shinyApp(ui, server)
}
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab