page_navbar | R Documentation |
Create a page that contains a top level navigation bar that can be used to
toggle a set of nav_panel()
elements. Use this page layout to create the
effect of a multi-page app, where your app's content is broken up into
multiple "pages" that can be navigated to via the top navigation bar.
page_navbar(
...,
title = NULL,
id = NULL,
selected = NULL,
sidebar = NULL,
fillable = TRUE,
fillable_mobile = FALSE,
gap = NULL,
padding = NULL,
header = NULL,
footer = NULL,
navbar_options = NULL,
fluid = TRUE,
theme = bs_theme(),
window_title = NA,
lang = NULL,
position = deprecated(),
bg = deprecated(),
inverse = deprecated(),
underline = deprecated(),
collapsible = deprecated()
)
Getting Started with Dashboards on the bslib website.
nav_panel()
, nav_menu()
, and nav_item()
for adding content
sections and organizing or creating items in the navigation bar.
layout_columns()
and layout_column_wrap()
for laying out content
into rows and columns.
card()
for wrapping outputs in the 'main' content area.
value_box()
for highlighting values.
accordion()
for grouping related input controls in the sidebar
.
Other Dashboard page layouts:
page_fillable()
,
page_sidebar()
library(shiny)
library(bslib)
link_shiny <- tags$a(
shiny::icon("github"), "Shiny",
href = "https://github.com/rstudio/shiny",
target = "_blank"
)
link_posit <- tags$a(
shiny::icon("r-project"), "Posit",
href = "https://posit.co",
target = "_blank"
)
ui <- page_navbar(
title = "My App",
nav_panel(title = "One", p("First page content.")),
nav_panel(title = "Two", p("Second page content.")),
nav_panel("Three", p("Third page content.")),
nav_spacer(),
nav_menu(
title = "Links",
align = "right",
nav_item(link_shiny),
nav_item(link_posit)
)
)
server <- function(...) { } # not used in this example
shinyApp(ui, server)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.