awesomeCheckboxGroup: Awesome Checkbox Group Input Control

Description Usage Arguments Value See Also Examples

View source: R/input-awesomecheckbox.R

Description

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

Usage

1
2
3
4
5
6
7
8
9
awesomeCheckboxGroup(
  inputId,
  label,
  choices,
  selected = NULL,
  inline = FALSE,
  status = "primary",
  width = NULL
)

Arguments

inputId

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

label

Input label.

choices

List of values to show checkboxes for.

selected

The values that should be initially selected, if any.

inline

If TRUE, render the choices inline (i.e. horizontally)

status

Color of the buttons

width

The width of the input

Value

A checkbox control that can be added to a UI definition.

See Also

updateAwesomeCheckboxGroup

Examples

 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
if (interactive()) {


ui <- fluidPage(
  br(),
  awesomeCheckboxGroup(
    inputId = "id1", label = "Make a choice:",
    choices = c("graphics", "ggplot2")
  ),
  verbatimTextOutput(outputId = "res1"),
  br(),
  awesomeCheckboxGroup(
    inputId = "id2", label = "Make a choice:",
    choices = c("base", "dplyr", "data.table"),
    inline = TRUE, status = "danger"
  ),
  verbatimTextOutput(outputId = "res2")
)

server <- function(input, output, session) {

  output$res1 <- renderPrint({
    input$id1
  })

  output$res2 <- renderPrint({
    input$id2
  })

}

shinyApp(ui = ui, server = server)


}

Example output



shinyWidgets documentation built on Sept. 17, 2021, 5:06 p.m.