Search code examples
rshinyshinydashboardshinyappsshiny-reactivity

R Shiny - How to position an image from top


I've used the below script but getting the image not aligned properly as it is not in the same line as the header.

How to move the logo from top to the desired location?

tags$img(src="R.png", height = 50, length = 50, align = "left"),

Solution

  • Earlier I used "ShinyUI" and now changed to "dashboardPage" which itself solved the issue and the image got automatically adjusted and aligned.

    Below are the arguments I used.

    title = tags$a(href = 'https://google.com',
                   tags$img(src = 'logo.png', height= 50,width= 50, align = "left"),
                   'Title')
    
    header = dashboardHeader(title = title, titleWidth = 400)
    
    
    ui = dashboardPage(header, sidebar, body, tags$head(tags$link(rel = "stylesheet", type = "text/css", href = "custom1.css")))
    
    

    Thanks to Abhinav...

    watch this video for more details