1. Core purpose

Streamlit A framework for turning Python scripts into interactive apps with minimal structure. It is optimized for rapid exploration and communication of results.

Dash A framework for building declarative, callback-driven web applications using Plotly components. It is optimized for structured, production-style dashboards.


2. Execution model (most important difference)

Streamlit: script re-execution
  • The app is a Python script.
  • Any user interaction triggers a top-to-bottom re-run of the script.
  • State must be explicitly preserved.

Mental model:

A reactive notebook that re-executes on change.

Implication:

  • Very low cognitive overhead.
  • Care required for expensive computation and caching.

Dash: callback graph
  • The app defines a layout plus a directed graph of callbacks.
  • Only affected components are recomputed.
  • State lives in component properties.

Mental model:

A reactive UI with explicit dataflow.

Implication:

  • More boilerplate.
  • Stronger control over dependency and update behavior.

3. State management

AspectStreamlitDash
Default stateStatelessStateful
Persistencest.session_stateComponent props, dcc.Store
Mental costLowMedium
Explicit dataflowWeakStrong

In Streamlit, forgetting to manage state leads to recomputation. In Dash, state is part of the design.


4. Performance characteristics

Streamlit

  • Re-runs entire script per interaction
  • Caching via st.cache_data, st.cache_resource
  • Best for light-to-moderate workloads

Dash

  • Callback-level recomputation
  • Better suited to complex dashboards with many inputs
  • Scales more predictably with UI complexity

5. Layout and UI control

Streamlit

  • Linear, top-down layout
  • Limited control over complex layouts
  • Styling is constrained

Dash

  • HTML/CSS-based layout model
  • Full control over layout and responsiveness
  • More work, more flexibility

6. Typical use cases

Use caseStreamlitDash
Data explorationStrongModerate
PrototypingStrongModerate
Research demosStrongModerate
Production dashboardsWeak–moderateStrong
Complex interactivityWeakStrong

7. Developer experience trade-off

Streamlit optimizes for speed of thought. Dash optimizes for clarity of system structure.

A useful heuristic:

  • Use Streamlit when the app mirrors a notebook workflow.
  • Use Dash when the app mirrors a front-end application.

9. Summary table

DimensionStreamlitDash
Programming modelScript re-runCallback graph
Learning curveLowMedium
State handlingExplicit add-onFirst-class
UI complexityLimitedHigh
Production fitModerateStrong