1

I'm creating a shiny app and have come across an issue that i can't seem to find a solution to. I'm using shiny dashboard and am creating a menu system in the sideboard, and i would like to add some icons to the tabs. This works fine for all icons that does not have a - in the name, but i can't seem to figure out the once that do.

dashboardSidebar(
sidebarMenu(
  menuItem("General statistics", tabName= "general_stat", icon = icon("check")),
  menuItem("Multiple regressions", tabName= "mult_reg", icon = icon("code-branch"))
)

The "check" icon appears but not the "code-branch". What am i doing wrong?

This may be a simple issue, but I just can't seem to figure it out.

Florian
  • 24,425
  • 4
  • 49
  • 80
  • Also you can manually add them like I did for previous versions: https://stackoverflow.com/questions/32686195/shinydashboard-some-font-awesome-icons-not-working/32689957#32689957 – Pork Chop Feb 23 '18 at 15:57

1 Answers1

3

It is not caused by the dash; the code-branch icon is only available in Font Awesome v5.0.0, which is not used in the current release of Shiny [Shiny uses 4.7, see here]. As is mentioned on the linked code-branch page, the code-branch icon replaces Font Awesome 4's code-fork, so you could use that one for now:

enter image description here

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(
    sidebarMenu(
      menuItem("General statistics", tabName= "general_stat", icon = icon("check")),
      menuItem("Multiple regressions", tabName= "mult_reg", icon = icon("code-fork"))
    )),
  dashboardBody()


)

server <- function(input, output, session) {

}

shinyApp(ui, server)

Hope this helps!

Florian
  • 24,425
  • 4
  • 49
  • 80
  • 2
    Also you can manually add them like I did for previous versions: https://stackoverflow.com/questions/32686195/shinydashboard-some-font-awesome-icons-not-working/32689957#32689957 – Pork Chop Feb 23 '18 at 15:57
  • That's also a nice option! – Florian Feb 23 '18 at 16:04