HTMLSelect {shiny.blueprint} | R Documentation |
HTML select
Description
Documentation: https://blueprintjs.com/docs/#core/components/html-select
Usage
HTMLSelect(...)
HTMLSelect.shinyInput(inputId, ..., value = defaultValue)
Arguments
... |
Component props and children. See the official Blueprint docs for details. |
inputId |
The |
value |
Initial value. |
Value
Object with shiny.tag
class suitable for use in the UI of a Shiny app.
Examples
library(shiny.blueprint)
library(shiny)
setInput <- function(inputId, accessor = NULL) {
JS(paste0("x => Shiny.setInputValue('", inputId, "', x", accessor, ")"))
}
options <- list(
list(value = "a", label = "Apples"),
list(value = "b", label = "Bananas"),
list(value = "c", label = "Cherries")
)
ui <- function(id) {
ns <- NS(id)
tagList(
HTMLSelect(
onChange = setInput(ns("choice1"), ".target.value"),
options = options
),
textOutput(ns("text1")),
br(),
HTMLSelect.shinyInput(
inputId = ns("choice2"),
value = "b",
options = options
),
textOutput(ns("text2"))
)
}
server <- function(id) {
moduleServer(id, function(input, output, session) {
output$text1 <- renderText(deparse(input$choice1))
output$text2 <- renderText(deparse(input$choice2))
})
}
if (interactive()) shinyApp(ui("app"), function(input, output) server("app"))
[Package shiny.blueprint version 0.3.0 Index]