How to change breakpoint of navbarPage collapse in Shiny


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 and this but couldn't figure out how to get it to work with Shiny.

Many thanks for your help!

Toy Shiny app:


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:

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.