Help with st.success and st.errors

hello guys, can somebody help me with this?
if form button is pressed.
display st.success() for only 2 seconds?

Is there a particular reason to not use st.spinner - Streamlit Docs?

1 Like

This code seems to do the work, but it will prevent the application from doing anything else for those two seconds.

st.success("Congrats!")
time.sleep(2)
st.experimental_rerun()
1 Like

Thanks guys!!, sorry if I am bad in coding, Im just starting to learn.