{"id":23505,"library":"dash-mp-components","title":"Dash MP Components","description":"Dash components for the Materials Project, providing interactive UI elements to access and visualize materials data. Current version is 0.5.1, with releases triggered by Git tags via CI/CD. The library wraps common Materials Project API features into Dash components.","status":"active","version":"0.5.1","language":"python","source_language":"en","source_url":"https://github.com/materialsproject/dash-mp-components","tags":["dash","materials-project","components","data-visualization"],"install":[{"cmd":"pip install dash-mp-components","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core framework required to run Dash apps","package":"dash","optional":false},{"reason":"Provides Materials Project API client for data access","package":"mp-api","optional":false}],"imports":[{"note":"Wrong because the top-level module exposes components directly; submodule import may fail or be unsupported.","wrong":"from dash_mp_components.mpelementcard import MPElementCard","symbol":"MPElementCard","correct":"from dash_mp_components import MPElementCard"},{"note":"Wrong because Dash components are classes, not modules; they must be imported as named imports from the package.","wrong":"import dash_mp_components.MPMaterialsExplorer","symbol":"MPMaterialsExplorer","correct":"from dash_mp_components import MPMaterialsExplorer"}],"quickstart":{"code":"import dash\nfrom dash import html\nfrom dash_mp_components import MPElementCard\n\napp = dash.Dash(__name__)\napp.layout = html.Div([\n    MPElementCard(element='Si', api_key=os.environ.get('MP_API_KEY', 'your-key-here'))\n])\n\nif __name__ == '__main__':\n    app.run_server(debug=True)","lang":"python","description":"Minimal Dash app with an MPElementCard showing silicon data. Requires a valid Materials Project API key."},"warnings":[{"fix":"Use 'from dash_mp_components import ComponentName' rather than any nested submodule imports.","message":"Version 0.5.0+ changed the import path from 'dash_mp_components' to a different package structure; ensure you use the correct top-level import as shown in the docs.","severity":"breaking","affected_versions":">=0.5.0"},{"fix":"Set the MP_API_KEY environment variable or pass api_key as a prop to each component.","message":"Components require a Materials Project API key (MP_API_KEY environment variable or 'api_key' prop). Without it, components will fail silently or show an error state.","severity":"gotcha","affected_versions":"all"},{"fix":"Set the MP_API_KEY environment variable instead of passing api_key as a prop.","message":"The 'api_key' prop is deprecated in favor of using the global key via the environment variable. Future versions may remove the prop entirely.","severity":"deprecated","affected_versions":">=0.5.0"},{"fix":"Use Dash callbacks to rebuild the component layout when data dependencies change.","message":"Components are not reactive to prop changes after initialization; you must recreate the component to update data.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Upgrade to the latest version: pip install --upgrade dash-mp-components and use correct import: from dash_mp_components import MPElementCard","cause":"Using an outdated version or incorrect import path; the component might not exist in older releases.","error":"ImportError: cannot import name 'MPElementCard' from 'dash_mp_components'"},{"fix":"Ensure the component is part of a layout like: app.layout = html.Div([MPElementCard(...)])","cause":"Trying to use a component without wrapping it in a Dash layout container (e.g., html.Div).","error":"dash.exceptions.NoLayoutException: Layout must be a Dash component or a function that returns a Dash component"},{"fix":"Check the component's available props in the official documentation or source code; correct spelling and case.","cause":"Prop name misspelled or not available; props are case-sensitive and must match the component's documentation.","error":"TypeError: __init__() got an unexpected keyword argument 'some_prop'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}