Create a Bootstrap 386 navbar page
Create a Bootstrap 386 navbar menu
Update a Bootstrap 386 navbar on the client
navbar_page_386( title, ..., id = NULL, selected = NULL, position = c("static-top", "fixed-top", "fixed-bottom"), header = NULL, footer = NULL, inverse = FALSE, windowTitle = title ) navbar_menu_386(title, ..., menuName = title, icon = NULL) update_navbar_page_386(session, inputId, selected = NULL)
title | The title to display in the navbar |
---|---|
... |
|
id | If provided, you can use |
selected | The |
position | Determines whether the navbar should be displayed at the top
of the page with normal scrolling behavior ( |
header | Tag or list of tags to display as a common header above all tabPanels. |
footer | Tag or list of tags to display as a common footer below all tabPanels |
inverse |
|
windowTitle | The title that should be displayed by the browser window.
Useful if |
menuName | A name that identifies this |
icon | Optional icon to appear on a |
session | The |
inputId | The id of the |
A shiny tag
if (interactive()) { library(shiny) library(shiny386) ui <- navbar_page_386( "App Title", id = "tabset", tab_panel_386( "Tab 1", radio_input_386( "dist", "Distribution type:", c("Normal" = "norm", "Uniform" = "unif", "Log-normal" = "lnorm", "Exponential" = "exp") ), plotOutput("distPlot") ), tab_panel_386( "Tab 2", select_input_386( "variable", "Variable:", c("Cylinders" = "cyl", "Transmission" = "am", "Gears" = "gear") ), tableOutput("data") ), navbar_menu_386( "More", tab_panel_386("Summary", "Extra content 1"), "----", "Section header", tab_panel_386("Table", "Extra content 2") ) ) server <- function(input, output, session) { output$distPlot <- renderPlot({ dist <- switch(input$dist, norm = rnorm, unif = runif, lnorm = rlnorm, exp = rexp, rnorm) hist(dist(500)) }) output$data <- renderTable({ mtcars[, c("mpg", input$variable), drop = FALSE] }, rownames = TRUE) observe(print(input$tabset)) } shinyApp(ui, server) } if (interactive()) { library(shiny) library(shiny386) ui <- navbar_page_386( "App Title", id = "tabset", selected = "Tab 2", header = radio_input_386("controller", "Update tab", 1:4), tabPanel( "Tab 1", "Content 1" ), tabPanel( "Tab 2", "Content 2" ), navbar_menu_386( "More", tab_panel_386("Tab 3", "Extra content 1"), "----", "Section header", tab_panel_386("Tab 4", "Extra content 2") ) ) server <- function(input, output, session) { observeEvent(input$controller, { update_navbar_page_386(session, "tabset", selected = paste("Tab", input$controller) ) }) } shinyApp(ui, server) }