Hi,
Looked but don’t find anything relevant. I’d like to notify users of an action “e.g. email sent” then is shown then disappears after n seconds. SOmething like a toast or notification popup.
I’ve looked st.info, st.success etc, however these messages remain until the next render cycle.
Welcome any ideas, thanks!
Hi @LostGoatOnHill , please refer to st.empty() in the Streamlit documentation.
Cheers
Sorry, but I’m unclear how st.empty() helps here, could you elaborate please?
There is a win10toast library. Install and use something like
from win10toast import ToastNotifier
toaster = ToastNotifier()
#...
toaster.show_toast("Title", "Comment", duration=5)
If you need to pass some specific action on toast click:
def launch(url):
os.startfile(url)
toaster.show_toast("Title", "Comment", duration=5, callback_on_click=lambda: launch(url))