Checkbox inputs may have a single possible value.
checkboxInput( id = NULL, choices = "Choice 1", selected = "Choice 1" )
You may also specify multiple possible values.
checkboxInput( id = NULL, choices = c("Choice 1", "Choice 2", "Choice 3"), selected = c("Choice 1", "Choice 2") )
While checkbox input choices are typically laid out vertically you can lay out
the choices horizontally with inline = TRUE
.
checkboxInput( id = NULL, choices = c("Choice 1", "Choice 2", "Choice 3"), inline = TRUE # <- )
The switch input functions identical to the checkbox input with a different appearance.
switchInput( id = NULL, choices = c("Toggle 1", "Toggle 2", "Toggle 3"), selected = "Toggle 2" )
Changing the background color of a checkbox or switch input will modify the background color of the selected choices.
checkboxInput( .style %>% background("warning"), id = NULL, choices = c("Choice 1", "Choice 2"), selected = c("Choice 1", "Choice 2") )
switchInput( .style %>% background("success"), id = NULL, choices = c("Toggle 1", "Toggle 2"), selected = "Toggle 1" )
formGroup( label = "Label", checkboxInput( id = NULL, choices = c("Choice 1", "Choice 2") ), help = "Help text for the input" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.