ds_radio_group: Radio Group Component

View source: R/ds-input.R

ds_radio_groupR Documentation

Radio Group Component

Description

Create a reactive group of radio buttons. The value of whichever ds_radio() is checked is reported to Shiny as a single value via input[[inputId]] — mirroring how Shiny's own radioButtons() works.

Usage

ds_radio_group(
  inputId,
  label,
  choices,
  selected = NULL,
  size = NULL,
  disabled = FALSE,
  class = NULL
)

Arguments

inputId

Shiny input ID

label

The legend text for the group

choices

Named vector of choices (names are labels, values are values)

selected

Initially selected value. Defaults to the first choice.

size

Size variant ("sm", "md", "lg")

disabled

If TRUE, disables every radio button in the group

class

Additional CSS classes

Value

A Shiny tag object

Examples

ds_radio_group("opts",
  label = "Choose one",
  choices = c("Choice A" = "a", "Choice B" = "b", "Choice C" = "c"),
  selected = "a"
)

shinyds documentation built on Aug. 22, 2026, 5:08 p.m.