{"id":27676,"library":"dash-bootstrap-templates","title":"Dash Bootstrap Templates","description":"Provides Plotly figure templates that match Bootstrap themes for Dash apps, enabling seamless theming and a built-in theme switch component (ThemeSwitchAIO). Current version 2.1.0 requires Plotly 6. Released monthly with minor features and fixes.","status":"active","version":"2.1.0","language":"python","source_language":"en","source_url":"https://github.com/AnnMarieW/dash-bootstrap-templates","tags":["dash","bootstrap","plotly","theme","visualization"],"install":[{"cmd":"pip install dash-bootstrap-templates","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"Core requirement for figure templates. Version >=6 required for v2.x.","package":"plotly","optional":false},{"reason":"Required for bootstrap themes and ThemeSwitchAIO component.","package":"dash-bootstrap-components","optional":false}],"imports":[{"note":"Templates module is internal; use top-level import.","wrong":"from dash_bootstrap_templates.templates import load_figure_template","symbol":"load_figure_template","correct":"from dash_bootstrap_templates import load_figure_template"}],"quickstart":{"code":"import dash\nfrom dash import dcc, html\nfrom dash_bootstrap_templates import load_figure_template\nimport dash_bootstrap_components as dbc\nimport plotly.express as px\n\nload_figure_template('bootstrap')\napp = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])\ndf = px.data.gapminder()\nfig = px.scatter(df.query(\"year==2007\"), x=\"gdpPercap\", y=\"lifeExp\", size=\"pop\", color=\"continent\", template='bootstrap')\napp.layout = dbc.Container([dcc.Graph(figure=fig)])\nif __name__ == '__main__':\n    app.run(debug=True)","lang":"python","description":"Load the bootstrap template and apply it to a Plotly Express scatter plot."},"warnings":[{"fix":"pip install dash-bootstrap-templates==1.3.0 if you cannot upgrade Plotly.","message":"Version 2.0.0+ requires Plotly 6. Projects using Plotly 5 must pin to dash-bootstrap-templates==1.3.0.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Do not pass dbc_css; the function auto-detects stylesheets.","message":"The 'dbc_css' parameter in load_figure_template is deprecated and may be removed in future versions.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use dbc.themes.BOOTSTRAP (string) for the themes parameter.","message":"ThemeSwitchAIO requires dash-bootstrap-components >=1.0.0 and the initial theme must be passed as a string (e.g., 'BOOTSTRAP'), not as an object.","severity":"gotcha","affected_versions":">=1.2.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"pip install dash-bootstrap-templates","cause":"Package not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'dash_bootstrap_templates'"},{"fix":"Ensure load_figure_template() is called early, and pass template='bootstrap' or similar to Plotly figures.","cause":"load_figure_template() called before app layout is defined, or missing template parameter in figure.","error":"dash.exceptions.NoLayoutException: The layout was None at the time the app was started."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}