0

I am attempting to edit the header of my shiny application to include 3 items.

Example of output desired

  1. The title (on left)
  2. The sidebar menu (burger menu) next to title
  3. A company logo (on right)

I have followed some other posts and attempted to replicate their methods:

Unfortunately I cannot manage to replicate their solutions. I have managed to add the logo to the right side using the following:

header = dashboardHeader(title = div(dashboard_title, style="text-align: left;"))
header$children[[3]]$children <- tags$img(src=logo_path, align="right", height='50px')

But this removes the burger menu, which I need to retain. I could add the logo instead of the title (as described in one of the links above), but I need to have both items.

I am fairly new to css etc, and so it is entirely possible that the answer is in one of the above links but I was unable to modify it correctly.

Any and all help is appreciated. Thank you.

FitzKaos
  • 381
  • 3
  • 20

1 Answers1

1

After trying a fair few things and not getting anywhere I realised that the fix is actually very simple:

header$children[[3]]$children[[3]] <- div(tags$img(src=logo_path, align="right", height='50px'))

There are 3 children of the third children in header. The piece of code in the question was replacing all three with the logo. However, the solution only replaces the last bit of the header with the logo, retaining the burger menu.

FitzKaos
  • 381
  • 3
  • 20