import dash
from dash import dcc, html
import dash_bootstrap_components as dbc
app = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])
tab1_content = dbc.Card(
dbc.CardBody(
[
html.P("This is tab 1!", className="card-text"),
dbc.Button("Click Here", color="success"),
]
),
className="mt-3",
)
tab2_content = dbc.Card(
dbc.CardBody(
[
html.P("This is tab 2!", className="card-text"),
dbc.Button("Don't Click Here", color="danger"),
]
),
className="mt-3",
)
app.layout = dbc.Container([
html.Div("Example: style active tabs", className="mb-4"),
dbc.Tabs([
dbc.Tab(tab1_content, label="Tab1", tab_id="tab-1", active_label_style={"color":"green", "backgroundColor": "yellow"}),
dbc.Tab(tab2_content, label="Tab2", tab_id="tab-2", active_label_style={"color":"pink", "backgroundColor": "red"})
],
id="app_tabs",
active_tab="tab-1"
)
])
if __name__ == "__main__":
app.run_server(debug=True)