buttonGroupInput: Button group inputs

View source: R/input-button-group.R

buttonGroupInputR Documentation

Button group inputs

Description

A set of buttons with custom values.

Usage

buttonGroupInput(
  ...,
  id,
  choices = NULL,
  values = choices,
  labels = deprecated(),
  direction = "horizontal"
)

updateButtonGroupInput(
  id,
  choices = NULL,
  values = choices,
  enable = NULL,
  disable = NULL,
  session = getDefaultReactiveDomain()
)

Arguments

...

Additional named arguments passed as HTML attributes to the parent element.

id

A character string specifying the id of the reactive input.

choices

A character vector specifying the labels for each button in the group.

values

A character vector specifying the values of each button in the group, defaults to choices.

labels

Deprecated, see values.

direction

One of "horizontal" or "vertical" specifying the layout of the buttons, defaults to "horizontal".

enable

One of values indicating individual buttons to enable or TRUE to enable the entire input, defaults to NULL.

disable

One of values indicating individual buttons to disable or TRUE to disable the entire input, defaults to NULL.

session

A reactive context, defaults to getDefaultReactiveDomain().

Details

Layout options

Button groups can be laid in two directions, horizontal or vertical.

buttonGroupInput(
  .style %>%
    background("primary"),
  id = NULL,
  choices = c("Grape", "Raspberry", "Kiwi")
)

Vertical button groups can help fill available space.

buttonGroupInput(
  .style %>%
    background("primary"),
  id = NULL,
  choices = c("Cherry", "Apple", "Pear")
)
buttonGroupInput(
  id = "group1",
  choices = c("Once", "Twice", "Thrice"),
  values = c(1, 2, 3)
)

Styling the button group

buttonGroupInput(
  .style %>%
    background("primary"),
  id = "group2",
  choices = c("Button 1", "Button 2", "Button 3")
)

See Also

Other inputs: buttonInput(), checkbarInput(), checkboxInput(), chipInput(), fileInput(), formInput(), listGroupInput(), menuInput(), navInput(), radioInput(), radiobarInput(), rangeInput(), selectInput(), textInput()


nteetor/dull documentation built on June 10, 2022, 11:30 a.m.