Search code examples
htmlrheadershinyshinydashboard

Remove div in shiny app's title


I'm using shinydashboard, and I want to put an image in the title with the following code:

header <- dashboardHeader(
  title = div(img(src = 'logo.png',
                  height = 60,
                  width = 120))
)

Everything goes well, but when I open the app by chrome, in my browser's tag, it looks very weird like below.

enter image description here

Is there any way to keep this from showing on the browser and show some normal text?

<div> <img src="logo.png" height="60" width="120"/>

Solution

  • Since you're overwriting Dashboard's Title, You've to explicitly mention the page title with tags$title

    tags$title('This is my page')
    

    For shinydashboard:

    ui <- dashboardPage(title = 'This is my title', header, sidebar, body, skin='red')