yonder icon indicating copy to clipboard operation
yonder copied to clipboard

Shorthand notation for inputs' `choices` argument

Open nteetor opened this issue 6 years ago • 0 comments

Shiny by default uses a shorthand notation for inputs.

radioButtons(
  inputId = "radio1",
  label = "Radio input",
  choices = c(
    `Choice 1` = 1,
    `Choice 2` = 1
  )
)

Yonder does not currently support this, but given #180, possible changes to buttonGroupInput()s, and possible changes to navInput()s I think it'd be a good idea to support this shorthand.

Instead of modifying the behaviour of choices, a new argument could be added. Possible names of the top of my head: pairs, choices_values, items.

@emmanuelsegui, have you found the required usage of choices + values cumbersome? Are there instances when specifying a named list of values would have been useful or more intuitive?

nteetor avatar Feb 20 '20 22:02 nteetor