1

actionbttn in shinywidget package only have several option for its button color. How do I change it into other color that is not provided by default?

matchbox13
  • 73
  • 13

1 Answers1

3

For example, I have this actionBttn wrapped in div() for further CSS styling :

div(class = "buttonagency",
actionBttn(inputId = "button.agency", label = "Agency",
style = "jelly", color = "primary",size = "sm"))

I chose "primary" as my default color. It doesn't matter which default color that you choose, as long as you choose one.

At the end of my UI, I add tags$style() for all CSS styling that I use in my shiny dashboard. To change the button color, I wrote down CSS style addresing first the button's CSS class, .bttn, and the default color that I chose, followed by whatever color I want it to change into. It looks like this:

.buttonagency .bttn-primary{background-color: red;}

Hope it helps.

matchbox13
  • 73
  • 13