Skip to content

dynamically set nav_bar title #1700

@micboat

Description

@micboat

Instead of using "Current Year" and "Base Year" as the title of my nav_bar, how can I set those to dynamically respond to the year selected.

from shiny.express import render, input, ui, output_args, session

with ui.sidebar(open="open"):
    ui.input_selectize(
        "currentyear_filter",  ui.h6("Select Comparison Years"), 
        choices=['2023', '2024'],
        selected="2024",
        multiple=False
    )

    ui.input_selectize(
        "baseyear_filter", 
        "",
        choices=['2016', '2023', '2024'], 
        selected="2023",
        multiple=False
    )
    
    

with ui.nav_panel("Data"): 
            with ui.navset_card_tab(id='tables'):
                with ui.nav_panel( "Current Year"):  #TODO: set current year nav title based 'currentyear_filter'
                    print("Current Year Content Here")
                    
                with ui.nav_panel( "Base Year"):  #TODO: set base year nav title based 'baseyear_filter'
                    print("Base Year Content Here")

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions