1

I have the following Shiny App.

library(shiny)
ui <- shinyApp(
  shinyUI(
    navbarPage("X-men",
               tabPanel("Plot"),
               tabPanel("Summary" )
            )),
server <- shinyServer(function(input, output) {})
               )
# Run the application 
shinyApp(ui = ui, server = server)

Which produce things like this:

enter image description here

As stated in that image. How can I move Summary tab panel to the right?


Update

After HubertL suggestion :

enter image description here

Notice the distortion and it's not "Summary" which get moved to the right.

1 Answer 1

1

You can extend the width of nav-bar and set its first-child position to float:right :

shinyApp(ui = shinyUI(
    navbarPage("X-men", selected="Plot",
               tabPanel("Summary" ),
               tabPanel("Plot"),
               tags$head(tags$style('.navbar-nav {width: 95%;}
                                    .navbar-nav :first-child{float:right}'))
                   )),
  server = shinyServer(function(input, output) {}))

Edit :

Added selected="Plot" to keep Plot as the active tabset enter image description here

6
  • It does on my setup
    – HubertL
    Apr 6, 2017 at 2:53
  • I'm sorry it doesn't on yours
    – HubertL
    Apr 6, 2017 at 2:53
  • it also works on firefox... Have you used my whole code? (reversing tab order?)
    – HubertL
    Apr 6, 2017 at 2:57
  • Ok. My bad. Is there a way to make it work on fixedPage() context?
    – neversaint
    Apr 6, 2017 at 3:12
  • if I have multiple tabPanel's and navbarMenu's , how do I get a very specific one to move to the right? Mar 25, 2019 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.