Vizro Dash Components
Vizro Dash Components are used by the Vizro framework but can be used in a pure Dash app. Use as import vizro_dash_components as vdc.
See the example Dash app and its live demo on PyCafe for a full demo of all components.
Installation
pip install vizro-dash-components
Components
Markdown
Based on dcc.Markdown, with identical properties. Renders Markdown content with syntax-highlighted code blocks via dmc.CodeHighlight and dmc.InlineCodeHighlight. Requires a dmc.MantineProvider wrapper.
import dash_mantine_components as dmc
import vizro_dash_components as vdc
from dash import Dash
app = Dash(__name__)
app.layout = dmc.MantineProvider(
vdc.Markdown(
id="my-markdown",
children="""
# Hello World
```python
print("Hello, World!")
```
""",
)
)
if __name__ == "__main__":
app.run()
Cascader
Hierarchical cascading dropdown inspired by Ant Design Cascader and fac.AntdCascader. Users navigate a tree of options via side-by-side panels and select leaves. Supports single-select and multi-select, and two value modes selected by full_path (see value format below). It accepts all the same arguments as dcc.Dropdown (for example className, style, clearable, searchable, search_value, placeholder, disabled, multi, optionHeight, maxHeight, debounce, closeOnSelect, labels, and persistence props) and is built to visually match it. Use help(vdc.Cascader) for the full list.
options format
options for dcc.Dropdown describes a flat list and can be given in two different formats: a shorthand and an explicit option dict. options for vdc.Cascader describes a tree and can similarly be given in two different formats:
-
Shorthand
dcc.Dropdown: a list, for example["New York City", "Montreal"].vdc.Cascader: a nested dict/list, for example{"USA": ["New York City", "Boston"], "Canada": ["Toronto", "Montreal"]}.
-
Explicit option dicts
dcc.Dropdown: a list of dicts, each withlabelandvalue, plus optional keys such asdisabledandsearch.vdc.Cascader: a list of dicts, each withlabelandvalue, plus optional keys such asdisabledandsearch. Parents also havechildren, a list of child dicts; leaves omitchildren.
value format
The shape of value depends on the full_path prop (default False):
- Leaf mode (
full_path=False, default):valueis the bare leaf scalar, for example"Paris"; whenmulti=Trueit is a list of leaf scalars, for example["Paris", "Tokyo"]. Leafvalues must be unique across the whole tree — a duplicate leafvalueunder two branches is ambiguous in this mode (the component logs a console error). This is a constraint onvalue, notlabel: two leaves may share alabelas long as theirvalues differ. - Path mode (
full_path=True):valueis the full root-to-leaf path: a list of nodevalues from the root down to the selected leaf, for example["Europe", "France", "Paris"]; whenmulti=Trueit is a list of such paths, for example[["Europe", "France", "Paris"], ["Asia", "Japan", "Tokyo"]]. Because paths are used, duplicate leafvalues in different branches (for example a"Portland"under both"Oregon"and"Maine") are addressed unambiguously.
from dash import Dash, Input, Output, html
import vizro_dash_components as vdc
OPTIONS = {
"Asia": {
"Japan": ["Tokyo", "Osaka", "Kyoto"],
"China": ["Beijing", "Shanghai", "Guangzhou"],
},
"Europe": {
"France": ["Paris", "Lyon", "Marseille"],
"Germany": ["Berlin", "Munich", "Hamburg"],
},
}
# Same tree in explicit form.
# label doesn't need to match value any more.
# Optional on any dict: disabled, search.
# OPTIONS = [
# {
# "label": "Asia",
# "value": "Asia",
# "children": [
# {
# "label": "Japan",
# "value": "Japan",
# "children": [
# {"label": "Tokyo", "value": "Tokyo"},
# {"label": "Osaka", "value": "Osaka"},
# {"label": "Kyoto", "value": "Kyoto"},
# ],
# },
# {
# "label": "China",
# "value": "China",
# "children": [
# {"label": "Beijing", "value": "Beijing"},
# {"label": "Shanghai", "value": "Shanghai"},
# {"label": "Guangzhou", "value": "Guangzhou"},
# ],
# },
# ],
# },
# ... similarly for Europe
# ]
app = Dash(__name__)
app.layout = [
vdc.Cascader(id="regions", options=OPTIONS, placeholder="Select a city..."),
html.Div(id="out"),
]
@app.callback(Output("out", "children"), Input("regions", "value"))
def show(value):
# Default leaf mode: `value` is the bare leaf, for example "Tokyo".
# Pass full_path=True to get the full path instead, for example ["Asia", "Japan", "Tokyo"].
return f"Selected: {value!r}"
if __name__ == "__main__":
app.run()
Development
Contributor workflows (Hatch, npm, regenerating vizro_dash_components/) are documented in AGENTS.md (same content as CLAUDE.md for Claude Code).
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vizro_dash_components-0.3.0.tar.gz.
File metadata
- Download URL: vizro_dash_components-0.3.0.tar.gz
- Upload date:
- Size: 887.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba80928236590ac77ba3aeb01f52cbc39d3cf3a5398527aef82a14e33471b72c
|
|
| MD5 |
22e69b252c822135e0b337263acdc7c4
|
|
| BLAKE2b-256 |
f8f830116f689ad6a07ca18d3d62c67953c19fb75000b875afea5c05e50adf40
|
Provenance
The following attestation bundles were made for vizro_dash_components-0.3.0.tar.gz:
Publisher:
release-if-needed.yml on mckinsey/vizro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vizro_dash_components-0.3.0.tar.gz -
Subject digest:
ba80928236590ac77ba3aeb01f52cbc39d3cf3a5398527aef82a14e33471b72c - Sigstore transparency entry: 2280493778
- Sigstore integration time:
-
Permalink:
mckinsey/vizro@b9f6e0d2d310948d21c88d4f5db26921e6d48fcd -
Branch / Tag:
refs/heads/main - Owner: https://github.com/mckinsey
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-if-needed.yml@b9f6e0d2d310948d21c88d4f5db26921e6d48fcd -
Trigger Event:
push
-
Statement type:
File details
Details for the file vizro_dash_components-0.3.0-py3-none-any.whl.
File metadata
- Download URL: vizro_dash_components-0.3.0-py3-none-any.whl
- Upload date:
- Size: 829.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29eaa876fad7279042373ddc0441703c7b699aec78dbe0da5229c2a048f066b3
|
|
| MD5 |
e36c68873b77a6d51db81980bd8ad061
|
|
| BLAKE2b-256 |
f8dd382141b71ae3a20531b060d056f46463473fa9f9368f5adf1120e7d97c1a
|
Provenance
The following attestation bundles were made for vizro_dash_components-0.3.0-py3-none-any.whl:
Publisher:
release-if-needed.yml on mckinsey/vizro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vizro_dash_components-0.3.0-py3-none-any.whl -
Subject digest:
29eaa876fad7279042373ddc0441703c7b699aec78dbe0da5229c2a048f066b3 - Sigstore transparency entry: 2280493786
- Sigstore integration time:
-
Permalink:
mckinsey/vizro@b9f6e0d2d310948d21c88d4f5db26921e6d48fcd -
Branch / Tag:
refs/heads/main - Owner: https://github.com/mckinsey
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-if-needed.yml@b9f6e0d2d310948d21c88d4f5db26921e6d48fcd -
Trigger Event:
push
-
Statement type: