Choose Streamlit to turn a script into a data app quickly, Dash for dashboards where you control every interaction, Shiny for Python for reactive apps that only recompute what changed, Gradio to put a web interface on a machine learning model, and Panel to turn notebook work into an app with whichever plotting library you already use. This post builds the same app in all five so you can compare them directly.
Quick Example
| Framework | How it reacts to input | Start it with | Default port | License |
|---|---|---|---|---|
| Streamlit 1.67 | Reruns the whole script | streamlit run app.py |
8501 | Apache 2.0 |
| Dash 4.5 | Callbacks with declared inputs and outputs | python app.py |
8050 | MIT |
| Shiny 1.9 | Reactive graph tracks dependencies | shiny run app.py |
8000 | MIT |
| Gradio 6.32 | Event listeners on components | python app.py |
7860 | Apache 2.0 |
| Panel 1.11 | Functions bound to widgets | panel serve app.py |
5006 | BSD |
The test app has one slider that sets a smoothing window and one chart of 180 days of simulated river levels. Here it is in Streamlit. Save it as app.py and run streamlit run app.py:
import numpy as np
import pandas as pd
import plotly.express as px
import streamlit as st
rng = np.random.default_rng(5)
days = pd.date_range("2026-01-01", periods=180)
levels = pd.Series(2.4 + np.cumsum(rng.normal(0, 0.07, 180)), index=days)
st.title("River Level")
window = st.slider("Smoothing window (days)", 1, 30, 7)
smooth = levels.rolling(window, min_periods=1).mean()
fig = px.line(x=days, y=smooth, labels={"x": "", "y": "Level (m)"})
fig.update_traces(line_color="#1864ab")
st.plotly_chart(fig)
Install any of them with pip: pip install streamlit dash shiny gradio panel. The apps below also use numpy, pandas, plotly, and matplotlib.

Streamlit: Rerun the Script
There are no callbacks in the Streamlit version. st.slider returns a number, and moving it runs the file again from the top. That makes small apps very short and easy to read. As apps grow, you manage the reruns with caching, session state, and st.fragment.
New to it? Start with your first Streamlit app.
Dash: Explicit Callbacks
Dash separates the layout from the logic. You describe the page with components, give them IDs, and write functions that name which properties they read and write:
import numpy as np
import pandas as pd
import plotly.express as px
from dash import Dash, Input, Output, callback, dcc, html
rng = np.random.default_rng(5)
days = pd.date_range("2026-01-01", periods=180)
levels = pd.Series(2.4 + np.cumsum(rng.normal(0, 0.07, 180)), index=days)
app = Dash()
app.layout = html.Div(
[
html.H1("River Level"),
html.Label("Smoothing window (days)"),
dcc.Slider(1, 30, 1, value=7, id="window",
marks={1: "1", 7: "7", 14: "14", 21: "21", 30: "30"}),
dcc.Graph(id="chart"),
],
style={"maxWidth": "700px", "margin": "auto", "fontFamily": "sans-serif"},
)
@callback(Output("chart", "figure"), Input("window", "value"))
def update(window):
smooth = levels.rolling(window, min_periods=1).mean()
fig = px.line(x=days, y=smooth, labels={"x": "", "y": "Level (m)"})
fig.update_traces(line_color="#1864ab")
return fig
if __name__ == "__main__":
app.run(debug=True)
It's more code, and the payoff is control. Only the functions whose inputs changed run, and you decide how the page is built with HTML and CSS. Callbacks shouldn't modify global variables, because every user shares the process; keep per-user values in dcc.Store.
Shiny for Python: Reactive by Default
Shiny's Express syntax reads almost like Streamlit, but it behaves differently. Shiny records that chart reads input.window(), and reruns only that function when the slider moves:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from shiny.express import input, render, ui
rng = np.random.default_rng(5)
days = pd.date_range("2026-01-01", periods=180)
levels = pd.Series(2.4 + np.cumsum(rng.normal(0, 0.07, 180)), index=days)
ui.h2("River Level")
ui.input_slider("window", "Smoothing window (days)", 1, 30, 7)
@render.plot
def chart():
smooth = levels.rolling(input.window(), min_periods=1).mean()
fig, ax = plt.subplots()
ax.plot(days, smooth, color="#1864ab")
ax.set_ylabel("Level (m)")
fig.autofmt_xdate()
return fig
This version uses Matplotlib, which @render.plot supports directly. Plotly works too through the shinywidgets package. Shiny also has a Core syntax with a separate UI object and server function, which suits larger apps. If you know Shiny from R, the concepts carry over.
Gradio: Inputs, a Function, Outputs
Gradio is built around calling a Python function from a web page. With Blocks, you connect component events to functions:
import gradio as gr
import numpy as np
import pandas as pd
import plotly.express as px
rng = np.random.default_rng(5)
days = pd.date_range("2026-01-01", periods=180)
levels = pd.Series(2.4 + np.cumsum(rng.normal(0, 0.07, 180)), index=days)
def draw(window):
smooth = levels.rolling(int(window), min_periods=1).mean()
fig = px.line(x=days, y=smooth, labels={"x": "", "y": "Level (m)"})
fig.update_traces(line_color="#1864ab")
return fig
with gr.Blocks(title="River Level") as demo:
gr.Markdown("# River Level")
window = gr.Slider(1, 30, value=7, step=1, label="Smoothing window (days)")
plot = gr.Plot(label="River level")
window.change(draw, inputs=window, outputs=plot)
demo.load(draw, inputs=window, outputs=plot)
demo.launch()
Gradio has ready-made components for images, audio, chat, and files, which is why it's common for model demos. demo.launch(share=True) creates a temporary public link, good for up to a week, while the app keeps running on your machine. Anyone with that link can use it, so don't share anything that exposes private data.
Panel: Bind Functions to Widgets
Panel, part of the HoloViz project, connects widgets to functions with pn.bind:
import numpy as np
import pandas as pd
import panel as pn
import plotly.express as px
pn.extension("plotly")
rng = np.random.default_rng(5)
days = pd.date_range("2026-01-01", periods=180)
levels = pd.Series(2.4 + np.cumsum(rng.normal(0, 0.07, 180)), index=days)
window = pn.widgets.IntSlider(name="Smoothing window (days)", start=1, end=30, value=7)
def draw(window):
smooth = levels.rolling(window, min_periods=1).mean()
fig = px.line(x=days, y=smooth, labels={"x": "", "y": "Level (m)"})
fig.update_traces(line_color="#1864ab")
fig.update_layout(height=450)
return fig
pn.Column(
"# River Level",
window,
pn.pane.Plotly(pn.bind(draw, window), sizing_mode="stretch_width"),
max_width=700,
).servable()
The same objects display inside Jupyter, so you can build the app cell by cell and serve the notebook with panel serve notebook.ipynb. Panel renders Matplotlib, Plotly, Bokeh, Altair, and HoloViews objects.
Which Python Dashboard Framework Should You Choose?
| If you want to... | Pick |
|---|---|
| Get a data app working this afternoon | Streamlit |
| Build a multi-page dashboard with precise layout and interactions | Dash |
| Avoid recomputing unrelated parts without managing it yourself | Shiny |
| Demo a model that takes text, images, or audio | Gradio |
| Turn an existing notebook into an app | Panel |
A few questions settle most cases:
- How much will interactions depend on each other? Cross-filtering and chained inputs are more natural in Dash or Shiny than in a rerun-the-script model.
- What does your team already know? Plotly users will be at home in Dash, R users in Shiny.
- Where will it run? All five need a running Python server in their standard form. See deploying a Streamlit app for what that involves.
If you only need an interactive chart and no server-side Python, you may not need an app at all. A standalone Plotly HTML file can be emailed or hosted anywhere.