Description Usage Arguments See Also Examples
A dropdown menu for selecting a value.
1 2 3 4 5 6 7 8 9 10 11 12 |
inputId |
The |
choicesNames |
A |
choicesValues |
Vector corresponding to |
selected |
The initial selected value, must be an element of |
dropUp |
Open the menu above the button rather than below. |
dropWidth |
Width of the dropdown menu. |
dropMaxHeight |
Maximal height for the menu. |
dropPreScrollable |
Force scroll bar to appear in the menu. |
btnClass |
Class for buttons in dropdown menu, default is |
width |
The width of the input. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | if (interactive()) {
library(shiny)
library(esquisse)
ui <- fluidPage(
tags$h2("Drop Input"),
dropInput(
inputId = "mydrop",
choicesNames = tagList(
list(icon("home"), style = "width: 100px;"),
list(icon("flash"), style = "width: 100px;"),
list(icon("cogs"), style = "width: 100px;"),
list(icon("fire"), style = "width: 100px;"),
list(icon("users"), style = "width: 100px;"),
list(icon("info"), style = "width: 100px;")
),
choicesValues = c("home", "flash", "cogs",
"fire", "users", "info"),
dropWidth = "220px"
),
verbatimTextOutput(outputId = "res")
)
server <- function(input, output, session) {
output$res <- renderPrint({
input$mydrop
})
}
shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.