Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate possibility of passing {icons} icons to the shiny icon= argument #59

Closed
mitchelloharawild opened this issue Jul 26, 2021 · 3 comments

Comments

@mitchelloharawild
Copy link
Owner

Related: https://community.rstudio.com/t/use-of-open-source-icons-in-shiny/110056/5

@Moohan
Copy link

Moohan commented Aug 10, 2023

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.

@mitchelloharawild
Copy link
Owner Author

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")).

@mitchelloharawild
Copy link
Owner Author

mitchelloharawild commented Aug 16, 2023

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants