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
For those of you who have more than one image in the navbar, the title= will only work for one of the images, unless you like horrendous formatting.
This code below allows the user to append the header with a new image that is also hyperlinked. I used this to create a GitHub logo and link my repository.
# Create Right Side Logo/Image with Link
tags$script(HTML("var header = $('.navbar > .container-fluid');
header.append('
` ');
console.log(header)")
),
header.append through
All we are doing is tagging this section of code as HTML script, therefore everything is passed as a character string to R, and read as HTML code. Luckily we can change the size of the picture, and move it around using padding-left,right,top,bottom: _px.
Note that container-fluid is my nav-bar, but it may be different for your app. Additional formatting options can be included in the style portion of the code.
Note that you may also add text, and link it in this manner as well.
# Create Right Side Text
tags$script(HTML("var header = $('.navbar > .container-fluid');
header.append('Follow us on GitHub
');
)),
Again make sure header.append through