Registry /
web-framework / dash-bootstrap-components
Install & Compatibility
Where this runs
tested against v2.0.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 1.322s · 141.1MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 8.2s · import 1.272s · 141MB
145MB installed
● package 145MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
dbc
✓ import dash_bootstrap_components as dbc
html
✓ from dash import html
dcc
✓ from dash import dcc
Dash
✓ from dash import Dash
This quickstart demonstrates a basic Dash application using Dash Bootstrap Components. It includes a Bootstrap-styled container, an alert, a button, and an input field with a callback, all leveraging dbc's theming and components. It's crucial to include `external_stylesheets=[dbc.themes.BOOTSTRAP]` when initializing the Dash app for correct styling.
from dash import Dash, html, dcc
import dash_bootstrap_components as dbc
app = Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])
app.layout = html.Div([
dbc.Container([
html.H1("Hello dbc!"),
dbc.Alert("This is a primary alert", color="primary"),
dbc.Button("Click Me", color="success", className="me-2"),
dcc.Input(id="my-input", value="Hello world", type="text"),
html.Div(id="my-output")
])
])
@app.callback(
Output("my-output", "children"),
Input("my-input", "value"),
)
def update_output(input_value):
return f"You entered: {input_value}"
if __name__ == '__main__':
app.run_server(debug=True)
Debug
Known issues
breakingVersion 2.0.0 introduced a major upgrade to Bootstrap 5. This means CSS classes, styling, and some component properties may have changed significantly compared to 1.x.x versions. Direct migration without checking Bootstrap 5 documentation or dbc's changelog may lead to broken layouts.fixReview your application's CSS classes and dbc component properties against Bootstrap 5 documentation and the dbc 2.0 changelog. Update `external_stylesheets` to use `dbc.themes.BOOTSTRAP` or a compatible theme.
affects: 2.0.0 and above
gotchaDash Bootstrap Components require a compatible version of the `dash` library. For dbc versions 2.0.3 and newer, `dash>=3.0.4` is a strict requirement. Using an older `dash` version may lead to runtime errors or unexpected behavior.fixEnsure your `dash` installation meets the minimum version requirement, e.g., `pip install 'dash>=3.0.4'`.
affects: 2.0.3 and above (different requirements for earlier 2.x versions)
gotchaComponents will not be styled correctly without including Bootstrap CSS. You must pass `external_stylesheets=[dbc.themes.BOOTSTRAP]` (or another `dbc.themes` constant, or a custom URL) when initializing your `Dash` app.fixModify your `Dash` app initialization: `app = Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])`.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'dash_bootstrap_components'
The 'dash-bootstrap-components' package is not installed in the Python environment being used, or the Python interpreter cannot locate the installed package.
fixInstall the package using `pip install dash-bootstrap-components`. If using a virtual environment, ensure it is activated. Verify the correct Python interpreter is running the script.
TypeError: The dash_bootstrap_components.Row component (version X.X.X) received an unexpected keyword argument: 'no_gutters'
The `no_gutters` keyword argument for `dbc.Row` was deprecated in `dash-bootstrap-components` version 1.0.0 (which updated to Bootstrap 5) and replaced by Bootstrap's gutter utility classes.
fixRemove `no_gutters=True` from your `dbc.Row` component and instead apply `className='g-0'` to achieve the same effect of removing horizontal and vertical gutters, or use more specific gutter classes like `gx-0` or `gy-0`.
AttributeError: module 'dash_bootstrap_components.themes' has no attribute 'ZEPHYR' (or similar for other components/themes like 'ModalTitle', 'PaginationItem')
This error typically indicates a version mismatch, where a theme or component attribute used in the code does not exist or has been renamed/deprecated in the installed version of `dash-bootstrap-components` (e.g., 'ModalTitle' was introduced in v1.0.0, and theme availability can change).
fixCheck the official documentation for your installed `dash-bootstrap-components` version to confirm the correct naming and availability of components and themes. Consider upgrading to the latest version (`pip install --upgrade dash-bootstrap-components`) if you intend to use newer features or themes.
Dash Bootstrap components not showing / layout not working (e.g., columns stacking instead of aligning horizontally)
The necessary Bootstrap CSS stylesheet is not correctly linked to the Dash application, preventing `dash-bootstrap-components` from applying its styling.
fixEnsure you are linking a Bootstrap v5 compatible stylesheet when initializing your Dash app. The recommended way is to use `external_stylesheets=[dbc.themes.BOOTSTRAP]` (or another theme from `dbc.themes`) when creating your `dash.Dash` instance.
dbc.Button n_clicks callback not working (or callbacks not firing consistently for a button)
Common causes include duplicate `id`s for components in the layout, the `n_clicks` property resetting unexpectedly due to overall layout re-renders, or incorrect handling of `n_clicks` in the callback logic.
fixEnsure all components, especially those involved in callbacks, have unique `id`s. For callbacks using `n_clicks`, make sure `n_clicks` is the only `Input` if you want it to trigger only on clicks, or use `State` to access values from other components without triggering the callback. Also, inspect your callbacks for unexpected re-renders or issues causing the `n_clicks` value to reset (e.g., a component being re-created or a parent property changing).
Upgrade
Version history
2.0.4latest on PyPI · released Aug 20, 2025
Audit
Dependencies
dashrequiredRequired for building Dash applications; dbc 2.0.3+ requires dash>=3.0.4.