bulmaMenu(...)

Arguments

...

Slot for bulmaMenuItem and bulmaMenuLabel.

Note

You can include as many bulmaMenuLabel as you want. It is better to wrap a bulmaMenu in a bulmaContainer as well as bulmaColumns (see example).

Author

David Granjon, dgranjon@ymail.com

Examples

if(interactive()){
 library(shiny)
 
 shinyApp(
   ui = bulmaPage(
     bulmaTitle("Hello Bulma"),
     bulmaContainer(
       bulmaColumns(
         bulmaColumn(
           width = 4,
           bulmaMenu(
             
             # section 1
             bulmaMenuLabel(menu_label = "Title 1", target = "title1"),
             bulmaMenuItem(active = FALSE, item_label = "Subtitle 1"),
             bulmaMenuItem(active = FALSE, item_label = "Subtitle 2"),
             
             # section 2
             bulmaMenuLabel(menu_label = "Title 2", target = "title5"),
             bulmaMenuItem(active = FALSE, item_label = "Subtitle 1"),
             bulmaMenuItem(
               active = TRUE, 
               item_label = "Subtitle 2",
               bulmaMenuSubItem(subitem_label = "Subsubtitle 1"),
               bulmaMenuSubItem(subitem_label = "Subsubtitle 2"),
               bulmaMenuSubItem(subitem_label = "Subsubtitle 3")
             ),
             bulmaMenuItem(active = FALSE, item_label = "Subtitle 3"),
             bulmaMenuItem(active = FALSE, item_label = "Subtitle 4"),
             bulmaMenuItem(active = FALSE, item_label = "Subtitle 5"),
             
             # section 3
             bulmaMenuLabel(menu_label = "Title 3", target = "title10"),
             bulmaMenuItem(active = FALSE, item_label = "Subtitle 6"),
             bulmaMenuItem(active = FALSE, item_label = "Subtitle 7"),
             bulmaMenuItem(active = FALSE, item_label = "Subtitle 8")
             
           )
         ),
         bulmaColumn(
           width = 8,
           
           bulmaTitle("Only title 1, title 2 and title 3 have html anchors."),
           
           bulmaRadioInput(
             "select", 
             c("Miles per galon" = "mpg", "Rear axle ratio" = "drat"),
             selected = "mpg"
           ),
           
           lapply(1:10, FUN = function(i) {
             list(
               bulmaTitle(paste0("Title", i), id = paste0("title", i)),
               plotOutput(paste0("plot", i))
             )
           })
           
         )
       )
     )
   ),
   server = function(input, output) {
     lapply(1:10, FUN = function(i) {
       output[[paste0("plot", i)]] <- renderPlot(
         plot(1:nrow(mtcars), mtcars[[input$select]])
       )
     })
     
   }
 )
}