library(shinySelect)
library(shiny)
states <- HTMLgroupedChoices(
groups = lapply(list("East Coast", "West Coast", "Midwest"), function(x){
tags$h2(x, style="text-decoration: underline")
}),
labels = list(
lapply(list("NY", "NJ", "CT"), function(x){
tags$span(HTML("•"), x, style="color: red")
}),
lapply(list("WA", "OR", "CA"), function(x){
tags$span(HTML("•"), x, style="color: green")
}),
lapply(list("MN", "WI", "IA"), function(x){
tags$span(HTML("•"), x, style="color: blue")
})
),
values = list(
list("NY", "NJ", "CT"),
list("WA", "OR", "CA"),
list("MN", "WI", "IA")
)
)
Run the code above in your browser using DataLab