View source: R/input-checkbar.R
checkbarInput | R Documentation |
A stylized checkbox input. The checkbar input appears similar to a group of buttons, but with a checked or highlighted state.
checkbarInput(..., id, choices = NULL, values = choices, selected = NULL)
updateCheckbarInput(
id,
choices = NULL,
values = choices,
selected = NULL,
enable = NULL,
disable = NULL,
session = getDefaultReactiveDomain()
)
... |
Additional named arguments passed as HTML attributes to the parent element or tag elements passed as child elements to the parent element. |
id |
A character string specifying the id of the reactive input. |
choices |
A character vector or list of tag element specifying the
input's choices, defaults to |
values |
A vector of values specifying the values of the input's
choices, defaults to |
selected |
One or more of |
enable |
One of |
disable |
One of |
session |
A reactive context, defaults to |
Checkbars will expand to fill the width of their parent element.
checkbarInput( .style %>% background("secondary"), id = NULL, choices = c("Choice 1", "Choice 2", "Choice 3") )
If you want to adjust the width you can use the width()
utility.
checkbarInput( .style %>% background("secondary") %>% width(50), # <- id = NULL, choices = c("Choice 1", "Choice 2", "Choice 3") )
Like other inputs, checkbar inputs apply modified background styles
checkbarInput( .style %>% background("info"), id = NULL, choices = c("Choice 1", "Choice 2") )
Use a formGroup()
to add a label or help text to checkbar input.
formGroup( label = "Label", # <- checkbarInput( .style %>% border("dark") %>% font("light"), id = NULL, choices = c("Choice 1", "Choice 2") ), help = "Help text about the input" )
Other inputs:
buttonGroupInput()
,
buttonInput()
,
checkboxInput()
,
chipInput()
,
fileInput()
,
formInput()
,
listGroupInput()
,
menuInput()
,
navInput()
,
radioInput()
,
radiobarInput()
,
rangeInput()
,
selectInput()
,
textInput()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.