dropdownActionInput: Dropdown, choices with images and type: text, download link...

View source: R/input-dropdownAction.R

dropdownActionInputR Documentation

Description

Dropdown, choices with images and type: text, download link or action link

Usage

dropdownActionInput(
  inputId,
  label,
  choices,
  choicesType = "text",
  images = NA,
  width = 150
)

Arguments

inputId

The input slot that will be used to access the value.

label

Display label for the dropdown, NULL for no label.

choices

Vector of values to select from. If named, then that name is displayed to the user and the value is the id of the input (in clase is not plain text but an action or download link). For dividing lines use "separator" in the choices' vector as name or value.

choicesType

Vector indicating what HTML objects the choices are: download for download link; button for action link; text for plain text.

images

Vector of paths for images that are going to be placed at the begining of each choice.

width

Width in pixels of the dropdown.

Examples

## Not run: 
## Only run examples in interactive R sessions
if (interactive()) {

choices <- c('Obtener enlace' = 'get_link', 'separator' = NA, 'Archivo HTML' = 'get_html')
ui <- fluidPage(
    dropdownActionInput(inputId = 'dropdown', label = 'Options', choices = choices, choicesType = c('button', NA, 'download'))
    verbatimTextOutput('count')
)
server <- function(input, output) {

output$count <- renderPrint({
                   HTML(paste0(input$dropdown, '</br>', input$get_link))
                })
}
shinyApp(ui, server)
}

## End(Not run)


datasketch/shinyinvoer documentation built on June 2, 2025, 2:14 a.m.