Description Usage Arguments Value Examples
Create a toggle switch.
1 2 3 |
inputId |
The |
label |
Display a text in the center of the switch. |
value |
Initial value (TRUE or FALSE). |
onLabel |
Text on the left side of the switch (TRUE) |
offLabel |
Text on the right side of the switch (FALSE) |
onStatus |
Color (bootstrap status) of the left side of the switch (TRUE) |
offStatus |
Color (bootstrap status) of the right side of the switch (FALSE) |
size |
Size of the buttons ('default', 'mini', 'small', 'normal', 'large') |
disabled |
Logical. Disable the switch |
A switch control that can be added to a UI definition.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
## Only run examples in interactive R sessions
if (interactive()) {
ui <- fluidPage(
switchInput(inputId = "somevalue"),
verbatimTextOutput("value")
)
server <- function(input, output) {
output$value <- renderPrint({ input$somevalue })
}
shinyApp(ui, server)
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.