navs_tab {bslib} | R Documentation |
Navigation containers
Description
Render a collection of nav()
items into a container.
Usage
navs_tab(..., id = NULL, selected = NULL, header = NULL, footer = NULL)
navs_pill(..., id = NULL, selected = NULL, header = NULL, footer = NULL)
navs_pill_list(
...,
id = NULL,
selected = NULL,
header = NULL,
footer = NULL,
well = TRUE,
fluid = TRUE,
widths = c(4, 8)
)
navs_hidden(..., id = NULL, selected = NULL, header = NULL, footer = NULL)
navs_bar(
...,
title = NULL,
id = NULL,
selected = NULL,
position = c("static-top", "fixed-top", "fixed-bottom"),
header = NULL,
footer = NULL,
bg = NULL,
inverse = "auto",
collapsible = TRUE,
fluid = TRUE
)
navs_tab_card(..., id = NULL, selected = NULL, header = NULL, footer = NULL)
navs_pill_card(
...,
id = NULL,
selected = NULL,
header = NULL,
footer = NULL,
placement = c("above", "below")
)
Arguments
... |
a collection of |
id |
a character string used for dynamically updating the container (see |
selected |
a character string matching the |
header |
UI element(s) (tags) to display above the nav content. |
footer |
UI element(s) (tags) to display below the nav content. |
well |
|
fluid |
|
widths |
Column widths of the navigation list and tabset content areas respectively. |
title |
The title to display in the navbar |
position |
Determines whether the navbar should be displayed at the top
of the page with normal scrolling behavior ( |
bg |
a CSS color to use for the navbar's background color. |
inverse |
Either |
collapsible |
|
placement |
placement of the nav items relative to the content. |
See Also
Examples
library(shiny)
nav_items <- function(prefix) {
list(
nav("a", paste(prefix, ": tab a content")),
nav("b", paste(prefix, ": tab b content")),
nav_item(
tags$a(icon("github"), "Shiny", href = "https://github.com/rstudio/shiny", target = "_blank")
),
nav_spacer(),
nav_menu(
"Other links", align = "right",
nav("c", paste(prefix, ": tab c content")),
nav_item(
tags$a(icon("r-project"), "RStudio", href = "https://rstudio.com", target = "_blank")
)
)
)
}
if (interactive()) {
shinyApp(
page_navbar(
title = "page_navbar()",
bg = "#0062cc",
!!!nav_items("page_navbar()"),
footer = div(
style = "width:80%; margin: 0 auto",
h4("navs_tab()"),
navs_tab(!!!nav_items("navs_tab()")),
h4("navs_pill()"),
navs_pill(!!!nav_items("navs_pill()")),
h4("navs_tab_card()"),
navs_tab_card(!!!nav_items("navs_tab_card()")),
h4("navs_pill_card()"),
navs_pill_card(!!!nav_items("navs_pill_card()")),
h4("navs_pill_list()"),
navs_pill_list(!!!nav_items("navs_pill_list()"))
)
),
function(...) { }
)
}