if (interactive()) {
# Full example
colorSelectorExample()
# Simple example
ui <- fluidPage(
colorSelectorInput(
inputId = "mycolor1", label = "Pick a color :",
choices = c("steelblue", "cornflowerblue",
"firebrick", "palegoldenrod",
"forestgreen")
),
verbatimTextOutput("result1")
)
server <- function(input, output, session) {
output$result1 <- renderPrint({
input$mycolor1
})
}
shinyApp(ui = ui, server = server)
}
Run the code above in your browser using DataLab