Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you change the color of an icon in an R Shiny app?

I have a Shiny app that uses a couple icons from the Font Awesome library (built-in) in the UI:

icon("bolt")

icon("compass")

How do I change the color of each icon?

like image 436
Dale Kube Avatar asked Dec 02 '22 12:12

Dale Kube


1 Answers

At the beginning of the UI, insert tags$style(".fa-bolt {color:#E87722}") to change the color of the bolt icon. Similarly, add tags$style(".fa-compass {color:#E87722}") to change the color of the compass icon. This will apply the coloring to all bolt icons and compass icons in the app.

like image 161
Dale Kube Avatar answered Jan 07 '23 22:01

Dale Kube