mardi 21 juillet 2020

How can I define a fill color for each choice of a grouped checkbox input in R with shiny?

I am able to colour all checkboxes purple with the code below. How can I define different fill colors for each choice (A, B, C, D, E)? It would be great if someone could help me!

ui <- fluidPage(
                fluidRow( 
                 prettyCheckboxGroup(inputId ="var", label= "Select Letter", 
                                     choices =  c("A", "B", "C", "D", "E"),
                                     selected = c("A", "B", "C", "D", "E"),
                                     inline = FALSE, width = NULL)), 
                  
 tags$style(".pretty.p-default input:checked~.state label:after {background-color: #A901DB !important;}"),
)

server <- function(input, output, ...) {
}

shinyApp(ui, server)



Aucun commentaire:

Enregistrer un commentaire