ui.navset_pill_list

ui.navset_pill_list(
    *args
    id=None
    selected=None
    header=None
    footer=None
    well=True
    widths=(4, 8)
)

Render nav items as a vertical pillset.

Parameters

*args : NavSetArg | MetadataNode | Sequence[MetadataNode] = ()

A collection of nav items (e.g., shiny.ui.nav_panel).

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.

See Also

Example

See nav_panel

Examples

#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400

## file: app.py
from shiny import App, render, ui

app_ui = ui.page_fluid(
    ui.navset_pill_list(
        ui.nav_panel("A", "Panel A content"),
        ui.nav_panel("B", "Panel B content"),
        ui.nav_panel("C", "Panel C content"),
        ui.nav_menu(
            "Other links",
            ui.nav_panel("D", "Panel D content"),
            "----",
            "Description:",
            ui.nav_control(
                ui.a("Shiny", href="https://shiny.posit.co", target="_blank")
            ),
        ),
        id="selected_navset_pill_list",
    ),
    ui.h5("Selected:"),
    ui.output_code("selected"),
)


def server(input, output, session):
    @render.code
    def selected():
        return input.selected_navset_pill_list()


app = App(app_ui, server)