| checkboxInput {shiny} | R Documentation |
Checkbox Input Control
Description
Create a checkbox that can be used to specify logical values.
Usage
checkboxInput(inputId, label, value = FALSE, width = NULL)
Arguments
inputId |
The |
label |
Display label for the control, or |
value |
Initial value ( |
width |
The width of the input, e.g. |
Value
A checkbox control that can be added to a UI definition.
Server value
TRUE if checked, FALSE otherwise.
See Also
checkboxGroupInput(), updateCheckboxInput()
Other input elements:
actionButton(),
checkboxGroupInput(),
dateInput(),
dateRangeInput(),
fileInput(),
numericInput(),
passwordInput(),
radioButtons(),
selectInput(),
sliderInput(),
submitButton(),
textAreaInput(),
textInput(),
varSelectInput()
Examples
## Only run examples in interactive R sessions
if (interactive()) {
ui <- fluidPage(
checkboxInput("somevalue", "Some value", FALSE),
verbatimTextOutput("value")
)
server <- function(input, output) {
output$value <- renderText({ input$somevalue })
}
shinyApp(ui, server)
}
[Package shiny version 1.9.0 Index]