dcc.ConfirmDialogProvider Documentation

Send a ConfirmDialog when the user
clicks the children of this component, usually a button.

import dash
from dash.dependencies import Input, Output
import dash_html_components as html
import dash_core_components as dcc

external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']

app = dash.Dash(__name__, external_stylesheets=external_stylesheets)

app.layout = html.Div([
            'Click Me',
        message='Danger danger! Are you sure you want to continue?'

@app.callback(Output('output-provider', 'children'),
              [Input('danger-danger-provider', 'submit_n_clicks')])
def update_output(submit_n_clicks):
    if not submit_n_clicks:
        return ''
    return """
        It was dangerous but we did it!
        Submitted {} times

if __name__ == '__main__':

dcc.ConfirmDialogProvider Reference

Access this documentation in your Python terminal with:


Our recommended IDE for writing Dash apps is Dash Enterprise’s
Data Science Workspaces,
which has typeahead support for Dash Component Properties.
Find out if your company is using
Dash Enterprise

children (boolean | number | string | dict | list; optional): The children to hijack clicks from and display the popup.

cancel_n_clicks (number; default 0): Number of times the popup was canceled.

cancel_n_clicks_timestamp (number; default -1): Last time the cancel button was clicked.

displayed (boolean; optional): Is the modal currently displayed.

id (string; optional): The ID of this component, used to identify dash components in callbacks. The ID needs to be unique across all of the components in an app.

loading_state (dict; optional): Object that holds the loading state object coming from dash-renderer. loading_state has the following type: dict containing keys ‘is_loading’, ‘prop_name’, ‘component_name’. Those keys have the following types:

  • is_loading (boolean; optional): Determines if the component is loading or not
  • prop_name (string; optional): Holds which property is loading
  • component_name (string; optional): Holds the name of the component that is loading

message (string; optional): Message to show in the popup.

submit_n_clicks (number; default 0): Number of times the submit was clicked

submit_n_clicks_timestamp (number; default -1): Last time the submit button was clicked.