Adds a single toggle, displayed as a switch or checkbox to a website.
Usage
input_switch(label, id = label, ..., note = NULL, default_on = FALSE,
as.checkbox = FALSE)
Arguments
- label
Label of the input for the user.
- id
Unique id of the element to be created.
- ...
Additional attributes to set on the element.
- note
Text to display as a tooltip for the input.
- default_on
Logical; if TRUE
, the switch will start on.
- as.checkbox
Logical; if TRUE
, display the switch as a checkbox.
Value
A character vector of the contents to be added.
See also
For a group of switches, checkboxes, or radio buttons, use input_checkbox
.
Examples
if (FALSE) { # \dontrun{
input_switch("Label")
} # }