express.ui.navset_underline

express.ui.navset_underline(id=None, selected=None, header=None, footer=None)

Context manager for a set of nav items whose active/focused navigation links are styled with an underline.

This function wraps navset_underline.

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 it’s value).

header : TagChild = None

UI to display above the selected content.

footer : TagChild = None

UI to display below the selected content.

Examples

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

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

with ui.navset_underline(id="selected_navset_underline"):
    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_underline()