Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R shiny - Add logo in browser window using titlePanel

Tags:

html

css

r

shiny

I want to add a logo to the browser window in the same way as all browser windows are usually displayed:

enter image description here

titlePanel allows to add easily images to the application title, by using: titlePanel(title = div(img(src="myAppImage.jpg"), "My App Name") It is also possible to add the title that should be displayed by the browser window with windowTitle as a parameter.

However, it does not work when adding an image to the browser window. I tried: titlePanel(title = div(img(src="myAppImage.jpg"), "My App Name"), windowTitle = div(img(src="myBrowserImage.png"), "My Browser Name")). But this gives the following browser name: <img src ...>

What is the correct way of writing it?

like image 598
Qin Avatar asked Sep 02 '25 16:09

Qin


1 Answers

Not inside the titlePanel but you can add following inside the ui:

tags$head(
        tags$link(rel = "icon", type = "image/png", sizes = "32x32", href = "/myBrowserImage.png"))

Also you should put the image inside www folder.

like image 137
phago29 Avatar answered Sep 05 '25 07:09

phago29