express.ui.navset_pill_list
express.ui.navset_pill_list(
id=None,
selected=None,
header=None,
footer=None,
well=True,
widths=(4, 8),
)
Context manager for a set of nav items as a tabset inside a card container.
This function wraps navset_pill_list.
Parameters
id : Optional[str] = None
-
If provided, will create an input value that holds the currently selected nav item.
selected : Optional[str] = None
-
Choose a particular nav item to select by default value (should match its
value
). header : TagChild = None
-
UI to display above the selected content.
footer : TagChild = None
-
UI to display below the selected content.
well : bool = True
-
True
to place a well (gray rounded rectangle) around the navigation list. widths : tuple[int, int] = (4, 8)
-
Column widths of the navigation list and tabset content areas respectively.
Examples
#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400
## file: app.py
from shiny.express import input, render, ui
with ui.navset_pill_list(id="selected_navset_pill_list"):
with ui.nav_panel("A"):
"Panel A content"
with ui.nav_panel("B"):
"Panel B content"
with ui.nav_panel("C"):
"Panel C content"
with ui.nav_menu("Other links"):
with ui.nav_panel("D"):
"Page D content"
"----"
"Description:"
with ui.nav_control():
ui.a("Shiny", href="https://shiny.posit.co", target="_blank")
ui.h5("Selected:")
@render.code
def _():
return input.selected_navset_pill_list()