View source: R/input-dropdownAction.R
dropdownActionInput | R Documentation |
Dropdown, choices with images and type: text, download link or action link
dropdownActionInput(
inputId,
label,
choices,
choicesType = "text",
images = NA,
width = 150
)
inputId |
The |
label |
Display label for the dropdown, |
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. |
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.