bulmaMenu: bulma Menu

Description Usage Arguments Note Author(s) Examples

View source: R/bulma-menu.R

Description

Create a menu https://bulma.io/documentation/components/menu/.

Usage

1

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(s)

David Granjon, dgranjon@ymail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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]])
       )
     })
     
   }
 )
}

JohnCoene/shinybulma documentation built on Oct. 17, 2020, 8:57 p.m.