View source: R/input-toggleSwitch.R
toggleSwitchInput | R Documentation |
Switch state button
toggleSwitchInput(
inputId,
label = NULL,
on_label = "ON",
off_label = "OFF",
value = FALSE,
class_name = "switch-styles"
)
inputId |
The |
label |
Display label for the toggle switch, |
on_label |
Display label when toggle switch is on. |
off_label |
Display label when toggle switch is off. |
value |
Initial value of the toggle TRUE on, FALSE off. |
## Not run:
## Only run examples in interactive R sessions
if (interactive()) {
ui <- fluidPage(
toggleSwitchInput(inputId = 'toggle', label = 'The toggle switch', value = TRUE)
verbatimTextOutput('toggle_state')
)
server <- function(input, output) {
output$toggle_state <- renderPrint({
input$toggle
})
}
shinyApp(ui, server)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.