Skip to contents

Create a styled select dropdown using Designsystemet styles.

Usage

ds_select(
  inputId,
  choices,
  selected = NULL,
  size = NULL,
  disabled = FALSE,
  ...
)

Arguments

inputId

The input slot for Shiny reactivity

choices

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

selected

Initially selected value

size

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

disabled

If TRUE, disables the select

...

Additional attributes

Value

A Shiny tag object

Examples

ds_select("country",
  choices = c("Norway" = "no", "Sweden" = "se", "Denmark" = "dk"),
  selected = "no"
)
#> <select id="country" name="country" class="ds-input ds-shiny-input">
#>   <option value="no" selected>Norway</option>
#>   <option value="se">Sweden</option>
#>   <option value="dk">Denmark</option>
#> </select>