ui.nav_panel

ui.nav_panel(title, *args, value=None, icon=None)

Create a nav item pointing to some internal content.

Parameters

title : TagChild

A title to display. Can be a character string or UI elements (i.e., tags).

*args : TagChild = ()

UI elements to display when the item is active.

value : Optional[str] = None

The value of the item. Use this value to determine whether the item is active (when an id is provided to the nav container) or to programmatically select the item (e.g., update_navs). You can also provide the value to the selected argument of the navigation container (e.g., navset_tab).

icon : TagChild = None

An icon to appear inline with the button/link.

See Also

Examples

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

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

app_ui = ui.page_fluid(
    ui.navset_bar(
        ui.nav_panel("Page 1", "Page 1 content"),
        ui.nav_panel(
            "Page 2",
            ui.navset_card_underline(
                ui.nav_panel("Tab 1", "Tab 1 content"),
                ui.nav_panel("Tab 2", "Tab 2 content"),
                ui.nav_panel("Tab 3", "Tab 3 content"),
            ),
        ),
        title="Nav Panel Example",
    ),
)


def server(input: Inputs):
    pass


app = App(app_ui, server)