| materialSwitch {shinyWidgets} | R Documentation |
A toggle switch to turn a selection on or off.
materialSwitch(inputId, label = NULL, value = FALSE, status = "default", right = FALSE, inline = FALSE, width = NULL)
inputId |
The |
label |
Input label. |
value |
TRUE or FALSE. |
status |
Color, must be a valid Bootstrap status : default, primary, info, success, warning, danger. |
right |
Should the the label be on the right? default to FALSE. |
inline |
Display the input inline, if you want to place buttons next to each other. |
width |
The width of the input, e.g. '400px', or '100%'. |
A switch control that can be added to a UI definition.
updateMaterialSwitch, switchInput
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)
}
## End(Not run)