What you are asking is tricky and might not be possible because in shinydashboard, top-level navigation controls are located inside the dashboardSidebar (on the left side) and the content is contained inside dashboardBody (on the right side). If you place a navMenu inside dashboardBody, it would have to belong to a specific sidebar item and would disappear if you later click on another sidebar item.
You might need to change the way you want to achieve this. Depending on what you want to do, you might try :
creating a dashboardSidebar with menu items that would normally into the top-menu, and you can place all the controls for that menu under the associated tabItem. You can even make it all dynamic by using renderMenu()
in server.R :
output$menu <- renderMenu({
sidebarMenu(id = "sidebMenu",
menuItem("Load Data", tabName = "loadData", icon = icon("database"),
actionButton("press", "Press me")
)
})
The disadvantage of this is probably that the number of controls you can put inside a sidebar menu is limited while it still looks good. But this is how dashboard is made.
or
using a fullscreen dashboard without sidebar with dashboardSidebar(disable = TRUE)
and use a navigation menu in a similar way as in the example you mentioned. You will have no shinydashboard's sidebar and you would have to make your own sidebar just like in your example. This way, you might still enjoy the other features offered by shinydashboard like notifications, boxes, skins, status boxes etc. But this is just a suggestion, it is up to you.
Hope this helps.