# check out https://dash.plotly.com/ for documentation
# Note - PY.CAFE uses a pathname prefix, so the href needs to use the relative path.
# for more info see https://github.com/AnnMarieW/dash-multi-page-app-demos?tab=readme-ov-file#2-multi_page_pathname_prefix
import dash
import dash_bootstrap_components as dbc
app = dash.Dash(__name__, use_pages=True, external_stylesheets=[dbc.themes.BOOTSTRAP])
navbar = dbc.NavbarSimple(
dbc.DropdownMenu(
[
dbc.DropdownMenuItem(page["name"], href=page["relative_path"])
for page in dash.page_registry.values()
if page["module"] != "pages.not_found_404"
],
nav=True,
label="More Pages",
),
brand="Multi Page App Demo",
color="primary",
dark=True,
className="mb-2",
)
app.layout = dbc.Container(
[navbar, dash.page_container],
fluid=True,
)
if __name__ == "__main__":
app.run_server(debug=True)