Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Plotly · Class

Dash

Dash is the main application class for creating Python analytical web apps. Instantiate it, define a component layout, optionally register callbacks, and run the app to serve interactive Plotly-based interfaces.

How it works

Dash is the application object that connects a Python layout to a running web app. Instantiate it, assign components such as html.Div to layout, and call run to serve the result locally.

Syntax

Dash(name=None, server=True, use_pages=None, **kwargs)

Returns

A Dash application object.

Key points

  • The class is the entry point for building analytical applications in Python.
  • Dash provides a Python-first development model and is designed to work directly with Plotly.
  • The class is commonly imported alongside component and callback primitives from the dash package.
  • Callbacks are registered on the application through the app.callback decorator.
  • A Dash app can display Plotly figures while supporting interactions that feed Python callbacks.

Common mistakes

  • Dash is Python-focused, so application behavior does not require writing JavaScript.

Example: Minimal Dash application

from dash import Dash, html

app = Dash(__name__)
app.layout = html.Div("Hello, Dash!")

if __name__ == "__main__":
    app.run(debug=True)

Creates a Dash application, assigns a simple HTML layout, and starts the development server.

When to use it

Analytical dashboards

Build a Python web dashboard with interactive controls, charts, and callbacks.

Interactive Plotly apps

Place Plotly figures in a browser-based application with selection and click interactions.

Python-first data applications

Compose pages from Dash HTML and core components without writing JavaScript.

Interview questions

QWhat is the role of the Dash class?

Dash is the application object used to define and serve a Dash app. A typical app creates Dash(__name__), assigns a component tree to app.layout, and starts it with app.run().

Follow-up: How are Plotly figures embedded? Pass a figure to the figure property of dcc.Graph, which renders the Plotly visualization inside the app.

QHow does Dash relate to Plotly?

The class supports analytical applications built from Python components and integrates with Plotly figures. Its app layout can contain components such as html.Div and dcc.Graph.

Follow-up: What enables interactivity? Dash callbacks connect component properties so Python functions can update the user interface reactively.

QHow do you initialize and run a basic Dash app?

Create the app with Dash(__name__), define app.layout, and run it from the application file. The official example uses app.run(debug=True) to start the development server.

Follow-up: Why use __name__? It gives the application the module name, which is the conventional initialization value for a Python web application.

  • dcc.Graph
  • html.Div
  • app.layout
  • app.callback
  • Input
  • Output

Source: Dash: the open-source Python framework for data applications. Checked 2026-10-15.