Description Usage Arguments See Also Examples
Reactive checkbox and checkbar inputs. Users may select one or more choices.
The checkbox input appears as a standard checkbox or set of checkboxes. When
a checkbox input has no selected choices the reactive value is NULL
. Switch
inputs differ from checkboxes only in appearance.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | checkboxInput(
id,
choices = NULL,
values = choices,
selected = NULL,
...,
inline = FALSE
)
updateCheckboxInput(
id,
choices = NULL,
values = choices,
selected = NULL,
inline = FALSE,
enable = NULL,
disable = NULL,
valid = NULL,
invalid = NULL,
session = getDefaultReactiveDomain()
)
switchInput(id, choices, values = choices, selected = NULL, ...)
updateSwitchInput(
id,
choices = NULL,
values = choices,
selected = NULL,
enable = NULL,
disable = NULL,
valid = NULL,
invalid = NULL,
session = getDefaultReactiveDomain()
)
|
id |
A character string specifying the id of the reactive input. |
choices |
A character string or vector specifying a label or labels for the checkbox or checkbar. |
values |
A character string or vector specifying values for the
checkbox or checkbar input, defaults to |
selected |
One or more of |
... |
Additional named arguments passed as HTML attributes to the parent element or tag elements passed as child elements to the parent element. |
inline |
One of |
enable |
One of |
disable |
One of |
valid |
A character string specifying a message to the user indicating
how the input's value is valid, defaults to |
invalid |
A character string specifying a message to the user
indicating how the input's value is invalid, defaults to |
session |
A reactive context, defaults to |
Other inputs:
buttonGroupInput()
,
buttonInput()
,
checkbarInput()
,
chipInput()
,
fileInput()
,
formInput()
,
listGroupInput()
,
menuInput()
,
navInput()
,
radioInput()
,
radiobarInput()
,
rangeInput()
,
selectInput()
,
textInput()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ### One option
checkboxInput(
id = "checkbox1",
choices = "Choice 1",
selected = "Choice 1"
)
### Multiple options
checkboxInput(
id = "checkbox2",
choices = c("Choice 1", "Choice 2")
)
### Inline checkbox
checkboxInput(
id = "checkbox3",
choices = c("Choice 1", "Choice 2", "Choice 3"),
inline = TRUE
)
### Switches
switchInput(
id = "switch1",
choices = paste("Switch choice", 1:3),
selected = "Switch choice 3"
) %>%
active("indigo")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.