Combining dcc.Tabs and dcc.Location

You dont need to use Tab.
You can use dcc.Link inside Div, like this:

            html.Div([
                html.Div([
                    dcc.Link([
                        "Page1"
                    ], id="Page1", href="/Page1", className="set of classnames")
                ],id="Page1_link", className="set of classnames"),
                html.Div([
                    dcc.Link([
                        "Page2"
                    ], id="Page2", href="/Page2", className="set of classnames")
                ],id="Page2_link", className="set of classnames"),
            ], style={"display":"flex"})

A click on a dcc.Link doesnt refresh the page.

Then, you can use CSS to make your links looking like tabs.

1 Like