Skip to content
menubars for shiny apps
R JavaScript CSS
Branch: master
Clone or download
Latest commit aaf4209 Apr 10, 2015
Type Name Latest commit message Commit time
Failed to load latest commit information.
R Added submenus Apr 10, 2015
inst Added submenus Apr 10, 2015
man many changes; context menus working, dropdowns recreated to be more f… Apr 9, 2015
.Rbuildignore Initial Commit Mar 20, 2015
.gitignore Initial Commit Mar 20, 2015
DESCRIPTION updated urls Apr 7, 2015
NAMESPACE Added submenus Apr 10, 2015
shinyMenus.Rproj rename updates Apr 7, 2015


menus for shiny apps

I've renamed the repository from shinyMB to shinyMenus to be more discriptive and to reflect the fact that it isn't just menu bars, but other menus as well.

This is loosely based on the bsNavBar functions that used to be part of shinyBS. It is just a beginning but hopefully it will eventually be an improvement to those functions.

The idea is that you will be able to add standard shiny inputs to a menubar and shinyMB will make the necessary changes to make them work within the menubar. There will also be dropdowns that work like actionButtons, checkboxGroupInputs, or radioButtons. I hope also to reintroduce the ability to nest dropdowns, a feature that was removed from bootstrap3.

Install it with devtools:


Here is an example that shows what the package can do so far:


app <- shinyApp(
  ui = 
      smNavBar("testMenu", "shinyMB", full.width = TRUE, fixed = FALSE, 
              actionLink("testLink", "Link"),
              actionLink("testLink2", "Link #2"),
              textInput("n", "Sample Size", value = 1000),
                 smRadio("dist", "norm", "Normal", selected = TRUE),
                 smRadio("dist", "lnorm", "Lognormal"),
                 smRadio("dist", "unif", "Uniform")
              smQuickDropdown("qd2Test", parent = "navbar", "Quick Dropdown", c("Action 1", "Action 2", "Action 3"))
      smDropdown(actionLink("ddTest", "Dropdown"),
                 smHeader("Action Elements"),
                 smAction("action1", "Action"),
                 smAction("action2", "Another Action"),
                 smHeader("Checkbox Elements"),
                 smCheckbox("testCB", "cb1", "First Checkbox"),
                 smCheckbox("testCB", "cb2", "Second Checkbox"),
                 smCheckbox("testCB", "cb3", "Third Checkbox", selected = TRUE),
                 smHeader("More Checkboxes"),
                 smCheckbox("testCB2", "cb21", "First Checkbox", selected = TRUE),
                 smCheckbox("testCB2", "cb22", "Second Checkbox", selected = TRUE),
                 smCheckbox("testCB2", "cb23", "Third Checkbox"),
                 smHeader("Radio Elements"),
                 smRadio("testRB", "rb1", "First Radio"),
                 smRadio("testRB", "rb2", "Second Radio", selected = TRUE),
                 smRadio("testRB", "rb3", "Third Radio", selected = TRUE)
      smQuickDropdown("qdTest", "Quick Dropdown", c("Action 1", "Action 2", "Action 3")),
      smContextMenu("context1", "testPlot", 
                    smRadio("dist", "norm", "Normal", selected = TRUE),
                    smRadio("dist", "lnorm", "Lognormal"),
                    smRadio("dist", "unif", "Uniform")

  server = 
    function(input, output, session) {
      observeEvent(input$testCB2, ({print(input$testCB2)}))
      observeEvent(input$testRB, ({print(input$testRB)}))
      observeEvent(input$qdTest, ({print(input$qdTest)}))
      observeEvent(input[["Action 1"]], ({print(input[["Action 1"]])}))
      output$testPlot <- renderPlot({
        dist <- switch(input$dist,
                       norm = rnorm,
                       lnorm = rlnorm,
                       unif = runif


If you have ideas or suggestions please let me know in the issues section.

You can’t perform that action at this time.