0

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!

I used following packages: install.packages("shinyWidgets") install.packages("shiny")

library(shiny) library(shinyWidgets)

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)
Luzia
  • 33
  • 4

0 Answers0