How can I insert an image into the navbar on a shiny navbarPage()

后端 未结 4 538
一向
一向 2020-11-29 04:54

I am builidng a shiny application using a navbarPage() layout. I would like to insert an image to be on the right hand side of the screen, in the navigation bar

4条回答
  •  渐次进展
    2020-11-29 05:18

    This is based on @John Paul's answer but seems simpler to me. First put your page title in a variable since we will use it twice -- as the window title and on our page:

    PAGE_TITLE <- "My great title"
    

    Below in your fluid page:

      titlePanel(windowTitle = PAGE_TITLE,
                 title =
                   div(
                     img(
                       src = "my_logo.png",
                       height = 100,
                       width = 100,
                       style = "margin:10px 10px"
                     ),
                     PAGE_TITLE
                   )
                 ),
    

提交回复
热议问题