Dash HTML Components

2.0.0 · maintenance · verified Sat Apr 11

Dash HTML Components is a Python library that provides pure Python abstractions around all HTML5 tags, enabling developers to compose layouts for Dash web applications using Python classes instead of writing raw HTML. As of Dash 2.0, the development of this library has been integrated into the main Dash repository, and `dash-html-components` now primarily exists for backward compatibility. It is currently at version 2.0.0 and aligns its release cadence with the core Dash framework.

Warnings

Install

Imports

Quickstart

This minimal Dash application demonstrates how to create a basic layout using `dash.html` components. It defines a main `Div` containing a `H1` heading and another `Div` with two `P` paragraphs, applying inline styling to the inner `Div`.

from dash import Dash, html

app = Dash(__name__)

app.layout = html.Div([
    html.H1("Hello Dash"),
    html.Div([
        html.P("Dash converts Python classes into HTML elements."),
        html.P("This is a simple Dash app using html components.")
    ], style={'color': '#7FDBFF'})
])

if __name__ == '__main__':
    app.run_server(debug=True)

view raw JSON →