Skip to main content

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 (each returned as its full root-to-leaf path). 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:

  1. 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"]}.
  2. Explicit option dicts

    • dcc.Dropdown: a list of dicts, each with label and value, plus optional keys such as disabled and search.
    • vdc.Cascader: a list of dicts, each with label and value, plus optional keys such as disabled and search. Parents also have children, a list of child dicts; leaves omit children.

The vdc.Cascader component’s value is the full root-to-leaf path: a list of node values from the root down to the selected leaf, for example ["Europe", "France", "Paris"]. When multi=True it is a list of such paths, for example [["Europe", "France", "Paris"], ["Asia", "Japan", "Tokyo"]]. Because paths are used, duplicate leaf labels 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):
    # `value` is the full path, for example ["Asia", "Japan", "Tokyo"].
    return f"Selected path: {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

vizro_dash_components-0.2.0.tar.gz (878.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vizro_dash_components-0.2.0-py3-none-any.whl (828.2 kB view details)

Uploaded Python 3

File details

Details for the file vizro_dash_components-0.2.0.tar.gz.

File metadata

  • Download URL: vizro_dash_components-0.2.0.tar.gz
  • Upload date:
  • Size: 878.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vizro_dash_components-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6d424813c97b0253dc38c29c67b99ce70467acd66ab4deb2c3bee3815e1771e6
MD5 9dcd81f3d166ad0dce9a699cd3bc7769
BLAKE2b-256 c2c5adad1fd16e7e2edb2cc19d79a851b68b1f297e15ec30103776366acd9f42

See more details on using hashes here.

Provenance

The following attestation bundles were made for vizro_dash_components-0.2.0.tar.gz:

Publisher: release-if-needed.yml on mckinsey/vizro

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vizro_dash_components-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for vizro_dash_components-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2c27b50d6371ea72bb3f3a5829cecb61e6117d260df37c7bd094f945bf5d8f1
MD5 d0fffc4aff74b646a33a5cc5ea91e91c
BLAKE2b-256 7c434f41fd59e6e67d942bd47db6f3ef474f84b78e42620643df148c5f0ce891

See more details on using hashes here.

Provenance

The following attestation bundles were made for vizro_dash_components-0.2.0-py3-none-any.whl:

Publisher: release-if-needed.yml on mckinsey/vizro

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.3.0

2 files

This release

0.2.0 This release

2 files

0.1.1

2 files

0.1.0

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page