Using page_navbar in python shiny

I'm trying to create a simple navbarPage, which in shiny python seems should be created using page_navbar. I'm not able to get it to work and couldn't find any examples of using page_navbar in the shiny for python tutorial. I tried the following and I get the error "AttributeError: 'Tag' object has no attribute 'get_value'

from shiny import App, ui

app_ui = ui.page_navbar(ui.panel_title("Project X"),
       ui.nav("Tab1", "BLANK"),
       ui.nav("Tab2", "BLANK"
       ) 

       
)

app = App(app_ui, None)

Something similar that works is this, but the page title is above the navbar. In r shiny, a navbarPage has the title directly in the navbar.

from shiny import App, ui

app_ui = ui.page_fluid(ui.panel_title("Project X"),
    ui.navset_tab_card(
        ui.nav("Tab1", "BLANK"),
        ui.nav("Tab2", "BLANK"
        )
))

app = App(app_ui, None)

Any help or even just a simple example of the use of page_navbar would be greatly appreciated :slight_smile:

I found a way to do it...


from shiny import App, ui

from shiny import App, ui

app_ui = ui.page_navbar(
       ui.nav("Tab1", "BLANK"),
       ui.nav("Tab2", "BLANK2"),
       title = "Project X"
)

app = App(app_ui, None)

what's odd is the argument 'title' has to come at the end otherwise I get the error 'positional argument follows keyword argument' since the function starts with *args in the first argument position.

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.