Pass Data to Dash Modal and toggle on and off

If it’s not too late, I had to implement something similar for my Dash app. The only approach I was able to successfully implement was to create an empty Div in my app layout, create a callback for the bar plot clickData event and then compose/return a dbc.Modal object from it. You’ll send this object to the “children” property of the empty Div you’d created. No need to track the “n_clicks” input since the modal will anyway disappear when you click anywhere outside it in order to dismiss it.

Hope this helps.