Vizro Dash Components are used by the Vizro framework but can be used in a pure Dash app
Project description
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 leaf values. Supports single-select and multi-select. 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.
Only leaf values appear in the vdc.Cascader component’s value (single value or list when multi=True).
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):
return f"Selected leaf value: {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).
Project details
Release history Release notifications | RSS feed
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.1.1.tar.gz.
File metadata
- Download URL: vizro_dash_components-0.1.1.tar.gz
- Upload date:
- Size: 869.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1825ea1dc28d41424f5f4eae8558f9534a4434cca5681df68065be05923bbab2
|
|
| MD5 |
31937ca7332db6640727515aee913ce2
|
|
| BLAKE2b-256 |
16dc7e25070a4ebd1d67acc84ab8a926ae36a604a4d231953006fee3070d298a
|
Provenance
The following attestation bundles were made for vizro_dash_components-0.1.1.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.1.1.tar.gz -
Subject digest:
1825ea1dc28d41424f5f4eae8558f9534a4434cca5681df68065be05923bbab2 - Sigstore transparency entry: 1203325994
- Sigstore integration time:
-
Permalink:
mckinsey/vizro@b2887761ed367195b60c2668dc223dc96a25e821 -
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@b2887761ed367195b60c2668dc223dc96a25e821 -
Trigger Event:
push
-
Statement type:
File details
Details for the file vizro_dash_components-0.1.1-py3-none-any.whl.
File metadata
- Download URL: vizro_dash_components-0.1.1-py3-none-any.whl
- Upload date:
- Size: 827.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5017c47f4ce57a786d475200e58477327b4052e4adc0db5a4afddb17bb3e4860
|
|
| MD5 |
4aaafbf3d7a10d4861b5e01c2f38c995
|
|
| BLAKE2b-256 |
1e1c7fa3e0191b9a7ca9295d972ebe7219dd3d9dc7d7df33f6f70955a2ffdbb1
|
Provenance
The following attestation bundles were made for vizro_dash_components-0.1.1-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.1.1-py3-none-any.whl -
Subject digest:
5017c47f4ce57a786d475200e58477327b4052e4adc0db5a4afddb17bb3e4860 - Sigstore transparency entry: 1203325997
- Sigstore integration time:
-
Permalink:
mckinsey/vizro@b2887761ed367195b60c2668dc223dc96a25e821 -
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@b2887761ed367195b60c2668dc223dc96a25e821 -
Trigger Event:
push
-
Statement type: