checkboxInput: Checkbox Input Control

Description Usage Arguments Value Server value See Also Examples

View source: R/input-checkbox.R

Description

Create a checkbox that can be used to specify logical values.

Usage

1
checkboxInput(inputId, label, value = FALSE, width = NULL)

Arguments

inputId

The input slot that will be used to access the value.

label

Display label for the control, or NULL for no label.

value

Initial value (TRUE or FALSE).

width

The width of the input, e.g. '400px', or '100%'; see validateCssUnit().

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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)
}

shiny documentation built on Jan. 26, 2021, 1:06 a.m.