dash-wrap
Callback-identity-preserving component wrappers for Plotly Dash. Wrap
any Dash component in an html.Div (or other container) with arbitrary
sibling components — captions, headings, toolbars — while keeping the
wrapper a drop-in replacement for the inner component everywhere Dash
inspects it.
Output(chart, "figure")updates the inner graphchart.figure = figwrites through to the innerisinstance(chart, dcc.Graph)is stillTrue
Think of it as AIO, but callback-transparent.
Installation
pip install dash-wrap
Usage
from dash import Dash, Input, Output, dcc, html
from dash_wrap import wrap
app = Dash(__name__)
graph = dcc.Graph(id="revenue", figure=make_fig())
chart = wrap(graph, children=[graph, html.Small("Source: ABS")])
app.layout = html.Div([
html.Button("Refresh", id="btn"),
chart,
])
@app.callback(Output(chart, "figure"), Input("btn", "n_clicks"))
def update(n):
return make_fig(n)
Semantic <figure> + <figcaption>
chart = wrap(
graph,
container=html.Figure,
children=[graph, html.Figcaption("Revenue by year, 2018–2024")],
)
Stable named wrapper (subclassing)
from dash_wrap import ComponentWrapper
class ChartCard(ComponentWrapper[dcc.Graph]):
def __init__(self, graph: dcc.Graph, title: str) -> None:
super().__init__(
graph,
proxy_props=["figure", "config"],
children=[html.H3(title), graph],
className="card",
)
Public API
| Name | Purpose |
|---|---|
wrap |
Primary factory — auto proxy_props from registry, returns typed as inner. |
ComponentWrapper |
html.Div-based wrapper class; subclass for stable named wrappers. |
is_wrapped |
Check whether an object is a dash-wrap wrapper specifically. |
register_proxy_defaults |
Register default proxy props for custom component types. |
make_wrapper_class |
Generate Generic[T]-parameterised wrapper classes for non-Div containers. |
How it works
Three small pieces:
_set_random_idoverride returns the innermost component's id and doesn't set one on the wrapper — callbacks resolve to the inner, the outer div has no HTML id, noDuplicateIdError.__class__property spoofs the inner's class forisinstancewhiletype()still sees the container — Dash serialises the outer as its real type.__getattr__/__setattr__proxy selected props (figure,value, etc.) through to the inner.
See the full docs for recipes, nested-wrapper semantics, and caveats.
License
MIT
Metadata
Release files for dash-wrap 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dash_wrap-0.0.2.tar.gz | 52.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dash_wrap-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 67.5 kB
Release files / dash_wrap-0.0.2.tar.gz
| Download URL | dash_wrap-0.0.2.tar.gz |
|---|---|
| Size | 52.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
92ec39f3bbb3f615e87b4a43ee9f4f7a8e5297d51e5618488623fc113d3b99e2
|
|
BLAKE2b-256 checksum How to use checksums |
7efed001981c194dfa1d1e9bbc0733f892673177424b2752039168ccfb22adc4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 7, 2026.
Transparency logRelease files / dash_wrap-0.0.2-py3-none-any.whl
| Download URL | dash_wrap-0.0.2-py3-none-any.whl |
|---|---|
| Size | 14.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
41d19b7b1bbdaf0a49861c83de005b55af696d9d10b1078d5e143e511c86104d
|
|
BLAKE2b-256 checksum How to use checksums |
4e14bb0bb214d9dcfdef3cef4b9c4206b05f168688f7c40b793fa5d63dcdca5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 7, 2026.
Transparency log