I would like to use an image instead of the title in the navbar of my Shiny-Web-App.
An example was discussed and solved in this post:
How can I insert an image into the navbar on a shiny navbarPage()
However, it does not work in my case. I can't explain why either. Here you can see my reproducible example:
library(shiny)
ui <- navbarPage(
title = div(img(
src = "proxy-image.png",
height = 20,
width = 20,
style = "margin:1px 1px"
), "My title"),
collapsible = FALSE,
theme = bslib::bs_theme()
)
server <- function(input, output) {
}
shinyApp(ui, server)
I also added my image in the .png-format here:
My result looks like this:
Can someone help me to solve my problem?
Many thanks in advance!