Closed mitchelloharawild closed 1 year ago
This worked for me (and was the motivation behind Tom Jemmett doing #73)
I tried something like this in our existing Shiny Dashboard and it seemed to work fine.
tabPanel(
title = "Home",
icon = icons::health_icons("blood_bag"),
...)
This was a direct swap for icon = icon("building")
i.e. shiny::icon
that was there before.
Thanks! I'm closing this since this is a limitation of shiny's validateIcon()
function which is used in actionButton()
.
The equivalent result for buttons can be obtained with actionButton("rocket", list(fontawesome$solid$rocket, "Rocket"))
.
Minimal example:
library(shiny)
library(icons)
ui <- fluidPage(
actionButton("d1", "Rocket", icon = icon("rocket")),
actionButton("rocket", list(fontawesome$solid$rocket, "Rocket"))
)
server <- function(input, output) {}
shinyApp(ui = ui, server = server)
Related: https://community.rstudio.com/t/use-of-open-source-icons-in-shiny/110056/5