Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Font Awesome 5.7 icons in Shiny apps

Shiny’s icon() function only supports Font Awesome 4.7 icons. A full list of the icons supported by Shiny can be found here.

Since then, Font Awesome has been updated many times with new icons. How to use Font Awesome 5 icons in Shiny apps, or how to upgrade Font Awesome in Shiny to version 5?

like image 634
Bastián Olea Herrera Avatar asked Oct 24 '25 11:10

Bastián Olea Herrera


1 Answers

Adding the following line to your ui.r file will expand Shiny support for Font Awesome 5.7.2 icons:

tags$style("@import url(https://use.fontawesome.com/releases/v5.7.2/css/all.css);"),

Afterwards, you can use the function icon("icon-name") in your Shiny web app. For example, you can use icon("vote-yea") to check if these new Font Awesome icons are working as intended.

like image 180
Bastián Olea Herrera Avatar answered Oct 26 '25 09:10

Bastián Olea Herrera



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!