How to change breakpoint of navbarPage collapse in Shiny

Hi,

I'd like to use shiny::navbarPage(collapsible = TRUE) to collapse navigation elements into a menu when my Shiny app is viewed on small screens. By default, the collapse is triggered when the width of the browser is less than 940 pixels. Is there any way to customise this so that the collapse triggers with slightly larger browser widths, e.g., 1200 pixels?

I've had a look at this https://stackoverflow.com/questions/18192082/bootstrap-3-navbar-collapse?lq=1 and this https://stackoverflow.com/questions/19827605/change-bootstrap-navbar-collapse-breakpoint-without-using-less but couldn't figure out how to get it to work with Shiny.

Many thanks for your help!

Toy Shiny app:

library(shiny)

ui <- navbarPage("This app has a long title to take up space for the purposes of this example", collapsible = TRUE,
                 
                 tabPanel("Panel that also has a long title 1"),
                 tabPanel("Panel that also has a long title 2"),
                 tabPanel("Panel that also has a long title 3")
                 
                 )

server <- function(input, output) {}

shinyApp(ui = ui, server = server)

The solution from Pork Chop on SO: https://stackoverflow.com/questions/66302145/how-to-change-breakpoint-of-navbarpage-collapse-in-shiny/66359101?noredirect=1#comment117334618_66359101

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.