Favicon in Shiny

Sergio Fernández picture Sergio Fernández · May 7, 2015 · Viewed 7.8k times · Source

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

Answer

zx8754 picture zx8754 · May 7, 2015

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