Dash DAQ

0.6.0 · active · verified Thu Apr 16

Dash DAQ is a Plotly-maintained component library for Dash, providing a robust set of controls and indicators. It simplifies the integration of data acquisition and control interfaces into Dash applications, offering components like BooleanSwitch, ColorPicker, and Gauge. The current version is 0.6.0, released on March 11, 2025. It follows an irregular release cadence as part of the broader Dash ecosystem.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates a basic Dash application using the `daq.BooleanSwitch` component. It initializes a Dash app, defines a layout with the switch and a Div to display its state, and then sets up a callback to update the output based on the switch's 'on' property.

from dash import Dash, html, Input, Output, callback
import dash_daq as daq

app = Dash(__name__)

app.layout = html.Div([
    html.H1("Dash DAQ Boolean Switch Example"),
    daq.BooleanSwitch(
        id='my-boolean-switch',
        on=False,
        label='Toggle Switch'
    ),
    html.Div(id='boolean-switch-output', style={'marginTop': 20})
])

@callback(
    Output('boolean-switch-output', 'children'),
    Input('my-boolean-switch', 'on')
)
def update_output(on_status):
    return f'The switch is currently: {on_status}'

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

view raw JSON →