Search code examples
rshinyfavicon

Favicon in Shiny


I wanted to add a favicon to my WebApp

I'm using this line, but it doesn't work:

HTML("<link rel=\"icon\" type=\"image/png\" href=\"image.png\" />")

inside the ui.R script and outside the shinyUI() function. Also I have the image.png where the server.R and ui.R are. (I've also tried putting it inside the folder /www )

Do you know how to do it? Thanks


Solution

  • If you're using a local runapp, then putting one in /www/favicon.ico should work, I believe.

    You could also insert this somewhere in your UI:

    tags$head(tags$link(rel="shortcut icon", href="URL-to-favicon"))

    Joe Cheng