Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dropdown_input

Create dropdown Semantic UI component


Description

This creates a default *dropdown_input* using Semantic UI styles with Shiny input. Dropdown is already initialized and available under input[[input_id]].

Usage

dropdown_input(
  input_id,
  choices,
  choices_value = choices,
  default_text = "Select",
  value = NULL,
  type = "selection fluid"
)

Arguments

input_id

Input name. Reactive value is available under input[[input_id]].

choices

All available options one can select from.

choices_value

What reactive value should be used for corresponding choice.

default_text

Text to be visible on dropdown when nothing is selected.

value

Pass value if you want to initialize selection for dropdown.

type

Change depending what type of dropdown is wanted.

Examples

## Only run examples in interactive R sessions
if (interactive()) {
library(shiny)
library(shiny.semantic)
ui <- semanticPage(
  title = "Dropdown example",
  dropdown_input("simple_dropdown", LETTERS, value = "A"),
  p("Selected letter:"),
  textOutput("dropdown")
)
server <- function(input, output) {
  output$dropdown <- renderText(input[["simple_dropdown"]])
}

shinyApp(ui = ui, server = server)
}

shiny.semantic

Semantic UI Support for Shiny

v0.4.2
MIT + file LICENSE
Authors
Filip Stachura [aut], Dominik Krzeminski [cre], Krystian Igras [aut], Adam Forys [aut], Paweł Przytuła [aut], Jakub Chojna [aut], Olga Mierzwa-Sulima [aut], Ashley Baldry [ctb], Jakub Chojna [ctb], Olga Mierzwa-Sulima [ctb], Pedro Manuel Coutinho da Silva [ctb], Paweł Przytuła [ctb], Kamil Żyła [ctb], Rabii Bouhestine [ctb], Appsilon Sp. z o.o. [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.