express.ui.navset_hidden

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

Context manager for nav contents without the nav items.

This function wraps navset_hidden.

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 import reactive
from shiny.express import input, ui

with ui.sidebar():
    ui.input_radio_buttons("controller", "Controller", ["1", "2", "3"], selected="1")

with ui.navset_hidden(id="hidden_tabs"):
    with ui.nav_panel(None, value="panel1"):
        "Panel 1 content"
    with ui.nav_panel(None, value="panel2"):
        "Panel 2 content"
    with ui.nav_panel(None, value="panel3"):
        "Panel 3 content"


@reactive.effect
@reactive.event(input.controller)
def _():
    ui.update_navs("hidden_tabs", selected="panel" + str(input.controller()))