{"id":2911,"library":"dash-core-components","title":"Dash Core Components","description":"Dash Core Components (dcc) is a suite of interactive user interface components for building analytical web applications with Dash. It provides essential UI elements like dropdowns, sliders, graphs, and input fields. As of version 2.0.0, it is integrated directly into the main `dash` library, simplifying imports. Maintained by Plotly, its release cadence is tied to that of the overarching Dash framework, seeing significant updates with major Dash versions.","status":"active","version":"2.0.0","language":"python","source_language":"en","source_url":"https://github.com/plotly/dash","tags":["dash","plotly","ui","components","web-app","interactive","data visualization","frontend"],"install":[{"cmd":"pip install dash","lang":"bash","label":"Install Dash (includes Core Components)"}],"dependencies":[{"reason":"Dash Core Components are bundled with and imported directly from the `dash` library since version 2.0.0.","package":"dash","optional":false},{"reason":"Optional dependency for faster JSON serialization, improving callback performance in Dash 2.0+.","package":"orjson","optional":true}],"imports":[{"note":"Since Dash 2.0.0, core components are imported directly from the `dash` package. The `dash_core_components` package is now obsolete as a top-level import.","wrong":"import dash_core_components as dcc","symbol":"dcc","correct":"from dash import dcc"}],"quickstart":{"code":"from dash import Dash, html, dcc\n\napp = Dash(__name__)\n\napp.layout = html.Div([\n    html.H1(\"My Dash App with Core Components\"),\n    dcc.Dropdown(\n        ['New York City', 'Montréal', 'San Francisco'],\n        'Montréal',\n        id='city-dropdown'\n    ),\n    html.Div(id='output-container')\n])\n\n# Callbacks would typically be added here for interactivity\n\nif __name__ == '__main__':\n    app.run_server(debug=True)","lang":"python","description":"A minimal Dash application demonstrating the layout with a `dcc.Dropdown` component. This example initializes a Dash app, defines a simple layout containing a heading, a dropdown menu from `dcc`, and an empty div to display output (which would typically be updated by a callback)."},"warnings":[{"fix":"Update your import statements from `import dash_core_components as dcc` to `from dash import dcc`. Ensure your `dash` package is version 2.0.0 or higher.","message":"Dash 2.0.0 introduced a breaking change to import statements. Previously, `dash_core_components` was imported as a separate package. Now, `dcc` is imported directly from the `dash` namespace.","severity":"breaking","affected_versions":"dash-core-components < 2.0.0, dash < 2.0.0"},{"fix":"Upgrade your Python environment to Python 3.6 or newer. (Dash typically supports the latest Python 3 versions).","message":"Dash 2.0.0 (and thus dash-core-components 2.0.0) officially dropped support for Python 2. Applications using older Python versions will fail.","severity":"breaking","affected_versions":"dash-core-components < 2.0.0, dash < 2.0.0 (when migrating to 2.x)"},{"fix":"Explicitly use `Input(component_id=..., component_property=...)` and `State(component_id=..., component_property=...)` keyword arguments in your callback decorator.","message":"When defining callbacks in Dash 2.0.0+, if you are using `State` arguments in your `@app.callback` decorator, any `Input` arguments must now explicitly be named with `input=` (e.g., `Input(component_id='my-input', component_property='value')`). Previously, implicit naming was sometimes tolerated.","severity":"gotcha","affected_versions":"dash >= 2.0.0"},{"fix":"Apply custom CSS through the `assets` folder or utilize community-maintained styling libraries like `dash-bootstrap-components` (e.g., `pip install dash-bootstrap-components`).","message":"Dash Core Components provide functionality but minimal default styling. For aesthetically pleasing and consistent layouts, it's highly recommended to use external CSS stylesheets or integrate with a component library like `dash-bootstrap-components`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Wrap your output components (or sections of your layout) with `dcc.Loading` to display a spinner while callbacks are executing. Example: `dcc.Loading(id=\"loading-output-1\", children=html.Div(id=\"output-1\"))`.","message":"Callbacks that perform long-running operations can cause the UI to appear frozen. Use `dcc.Loading` to wrap components that are targets of such callbacks to provide visual feedback to the user.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'2.0.0':38 'analyt':18 'app':78 'applic':20 'build':17 'cadenc':55 'compon':3,6,15,75 'core':2,5 'dash':1,4,22,46,63,70,72 'data':80 'dcc':7 'direct':42 'dropdown':29 'element':27 'essenti':25 'field':34 'framework':64 'frontend':82 'graph':31 'import':49 'input':33 'integr':41 'interact':12,79 'interfac':14 'librari':47 'like':28 'main':45 'maintain':50 'major':69 'overarch':62 'plot':52,73 'provid':24 'releas':54 'see':65 'signific':66 'simplifi':48 'slider':30 'suit':10 'tie':57 'ui':26,74 'updat':67 'user':13 'version':37,71 'visual':81 'web':19,77 'web-app':76","created_at":"2026-04-11T09:12:54.033082+00:00","updated_at":"2026-04-16T05:05:46.550789+00:00","problems":[{"fix":"Change your import statements from `import dash_core_components as dcc` to `from dash import dcc`. Ensure your `dash` package is updated to version 2.0.0 or higher.","cause":"As of Dash version 2.0.0, `dash_core_components` and `dash_html_components` were integrated directly into the main `dash` library, meaning they are no longer separate top-level packages to import from.","error":"ModuleNotFoundError: No module named 'dash_core_components'"},{"fix":"Update your import statements to `from dash import dcc` and then refer to components as `dcc.Dropdown`, `dcc.Graph`, etc.","cause":"This error occurs when attempting to access a component (like `Dropdown` or `Graph`) using the old `dash_core_components` module after upgrading to Dash 2.0.0, where components are now part of the `dash.dcc` submodule.","error":"AttributeError: module 'dash_core_components' has no attribute 'Dropdown' (or 'Graph', 'Input', etc.)"},{"fix":"Before storing data in `dcc.Store`, convert the object into a JSON-serializable format, such as a dictionary, list, or string (e.g., using `df.to_json()` for DataFrames or `json.dumps()` for other objects), and then deserialize it in the callback when retrieved.","cause":"This error typically occurs when attempting to store a non-JSON-serializable Python object (such as a Pandas DataFrame, NumPy array, or custom class instance) directly into a `dcc.Store` component, which only supports JSON-compatible data.","error":"TypeError: Object of type DataFrame is not JSON serializable"},{"fix":"Ensure that when `multi=True`, the `value` property of `dcc.Dropdown` is always a list, for example, `value=['initial_selection']` instead of `value='initial_selection'`.","cause":"When `multi=True` is set for a `dcc.Dropdown`, its `value` property expects a list of selected values, even if only one item is selected. Providing a single string instead of a list will cause the selection not to be displayed correctly.","error":"dcc.Dropdown value not displaying selection when `multi=True` and `value` is a string (instead of a list)"},{"fix":"In your WSGI configuration or entry file (e.g., `wsgi.py`), ensure that the application variable exposed to the WSGI server refers to `app.server` and not `app` itself. For example, if your Dash app is `app = dash.Dash(__name__)`, then the WSGI callable should point to `application = app.server`.","cause":"This error often occurs in deployment scenarios, particularly with WSGI servers (like Gunicorn or uWSGI), when the WSGI application entry point is configured to call the `Dash` application instance directly, rather than its underlying Flask `server` attribute.","error":"TypeError: 'Dash' object is not callable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.0.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://dash.plotly.com","github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/dash-core-components/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-28","next_check":"2026-07-28","install_tag":null}}