[4.2.0] - 2026-06-01 - The Freedom Update
This release marks a major milestone for Dash, bringing unprecedented flexibility to how you build and deploy your applications.
🚀 Multiple Backend Support
Dash is no longer tied to Flask. You can now run your Dash apps on FastAPI or Quart, or even bring your own backend implementation:
# FastAPI backend
app = Dash(__name__, backend="fastapi")
# Quart backend (async-native)
app = Dash(__name__, backend="quart")
# Or use an existing server
from fastapi import FastAPI
server = FastAPI()
app = Dash(__name__, server=server)Install with pip install dash[fastapi] or pip install dash[quart].
⚡ Websocket Callbacks
Real-time, bidirectional communication is here. Websocket callbacks enable persistent connections for live updates without polling:
@callback(
Output("live-output", "children"),
Input("trigger", "n_clicks"),
websocket=True,
persistent=True
)
def live_updates(n_clicks):
ws = ctx.websocket
while True:
data = fetch_live_data()
ws.send(Output("live-output", "children", data))
time.sleep(1)🔓 Relaxed Pattern Matching Rules
MATCH wildcards are now allowed in Input and State even when your Output has no wildcards, making dynamic UIs simpler to build:
@callback(
Output("summary", "children"), # Fixed ID output
Input({"type": "item", "index": MATCH}, "value") # MATCH input - now allowed!
)
def update_summary(value):
return f"Selected: {value}"Added
- #3783 Add batching/debouncing for websocket
set_propsmessages to reduce lag when updating multiple components in a loop. Configurable viawebsocket_batch_delay(default 5ms, set to 0 to disable). - #3669 Selection for DataTable cleared with custom action settings.
- #3680 Added
search_orderprop toDropdownto allow users to preserve original option order during search. - #3745 Added
csrf_token_nameandcsrf_header_nameconfig options to allow configuring the CSRF cookie and header names. Fixes #729. - #3797 Improved websocket callback management with heartbeat configuration and proper reconnection handling.
- #3523 Fall back to background callback function names if source cannot be found.
- #3771 Add persistent callbacks and no inputs/no outputs callback support.
- #3742 Add websocket callbacks to fastapi and quart backends.
- #3737 Add
displayNotifiertodcc.Graphconfig props.
Changed
- #3746 Improve static typing for
dash.callbackby preserving wrapped callback signatures, and add callback typing coverage in compliance plus new callback decorator unit and integration tests. Fixes #3691. - Rename
ctx.get_websockettoctx.websocket. - Add threadpool for running websocket callbacks.
Fixed
- #3690 Fix
dcc.Inputwhen min or max is set to None. - #3723 Fix misaligned
dcc.Slidermarks when some labels are empty strings. - #3738 Add missing
stacklevel=2towarnings.warn()calls so warnings report the caller's location instead of internal Dash source lines. - #3740 Fix cannot tab into dropdowns in Safari.
- #3756 Allow
MATCHinInput/Statewhen the callback'sOutputhas no wildcards (fixed-id Output, no Output, orALL-only wildcard Output).ALLSMALLERstill requires a correspondingMATCHin an Output. Fixes #2462. - #3768 Improved
Dropdownsearch performance for large options lists. - #3759 Fix the issue where
Patchobjects cannot be updated viaset_props()inwebsocketcallback. Fix #3742. - #3789 Fixed extra wrapper in
DatePickerRangeandDatePickerSinglecausing styling and layout issues. - #3799 Fixed dropdown crash when filtering large datasets with component-based labels by using stable item keys for virtualized rows.
- #3785 Fix patch with
dcc.Graphfigure. Fixdcc.Graphnot sending duplicate clicks because it had the same payload by adding a timestamp in the click event object. - #3798 Fix blueprint registering and double init when using
flask runcommand. Fixes #3787. - #3734 Fix websocket used in the same FastAPI server. Fixes #3636.
- #3668 Fix FastAPI url paths order. Fixes #3667.
- #3641 Fix
dcc.Loadingspinner not triggering when callbackOutputuses theALLwildcard. Fixes #3619. - #3570 Fix components not remounting when passed from a parent object. Fixes #3330.