Search code examples
rshinyshinydashboard

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?


Solution

  • 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.