I have a multipage dash app. each page has its own python file (i.e page1.py, page2.py etc.).
On my app.py i have created a navbar which will have the path for each page and then i call dl.plugins.page_container to get all the pages.
This it the code:
# Initialize application
app_flask = flask.Flask(__name__)
server = app_flask
server.route("/application/")
app = dash.Dash(__name__,
routes_pathname_prefix="/application/",
plugins=[dl.plugins.pages])
server = app.server
# Create navbar
# Define navigation items
nav_items = [
("Page1", "page-1"),
("Page2", "page-2"),
]
# Create navbar items
navbar_items = [
html.Div([
dbc.Row(
dbc.NavItem(
dbc.NavLink(
label,
href=href,
)
)
)
])
for label, href in nav_items
]
# Assemble Navbar
navbar = dbc.Navbar(
dbc.Container(
[
html.A(
dbc.Row(
[
dbc.Col(html.Img(src=logo, height="50px")),
],
align="center",
className="g-0",
),
),
*navbar_items,
],
fluid=True
),
)
# Define app layout
app.layout = dbc.Container([navbar, dl.plugins.page_container], fluid=True)
This works as expected with navbar. However i want to instead of using the Navbar to use dcc.Tabs. I cannot get it to work.
Can someone please guide me with how should i update my code so that it works the same as now however instead of navbar use dcc Tabs.