# Menu container
if (interactive()) {
library(shiny)
library(shinyMobile)
shinyApp(
ui = f7Page(
title = "Menus",
f7SingleLayout(
navbar = f7Navbar(
title = "f7Menu",
hairline = FALSE,
shadow = TRUE
),
f7Button(inputId = "toggle", label = "Toggle menu"),
f7Menu(
f7MenuDropdown(
id = "menu1",
label = "Menu 1",
f7MenuItem(inputId = "item1", "Item 1"),
f7MenuItem(inputId = "item2", "Item 2"),
f7MenuDropdownDivider(),
f7MenuItem(inputId = "item3", "Item 3")
)
)
)
),
server = function(input, output, session) {
observeEvent(input$toggle, {
updateF7MenuDropdown("menu1")
})
observeEvent(input$item1, {
f7Notif(text = "Well done!")
})
observe({
print(input$item1)
print(input$menu1)
})
}
)
}
Run the code above in your browser using DataLab