There are many ways to do it. Using dash-extensions
, you just place the dynamic component container similar to the page container,
from dash import dash, Dash, html
from dash_extensions.pages import setup_dynamic_components
app = Dash(use_pages=True)
app.layout = html.Div(
children=[
dash.page_container,
setup_dynamic_components(),
]
)
if __name__ == "__main__":
app.run_server()
and then register the dynamic components on the pages where they should be visible,
from dash import html, register_page
from ... import complex_table
register_page(
__name__,
path="/",
dynamic_components=[complex_table]
)
def layout():
return html.Div("Welcome home!")
The complex table will now appear below the greeting on the welcome page (as well as on any other page, where it is registered).
Does that make sense?