Popup warning and confirmation?

Is there a way to ask the user β€œDo you really, really, wanna do this?”, before removing all the generated data and start from scratch? Like a popup window that opens up under certain conditions?

Hey @Soren !

The Modal / Popup window I believe is being discussed internally as part of future Streamlit layout options (you can track the issue here), so no release date yet for this :confused:

You can try and display a huge warning message with st.error and a button underneath which runs the expensive function on click:

st.error("Do you really, really, wanna do this?")
if st.button("Yes I'm ready to rumble"):
    run_expensive_function()

Best,
Fanilo

2 Likes