Hi everyone,
Long time streamlit user. Though I would share my latest package as I have been getting a lot of use out of it, so hopefully others might too. I always found annoying to display status elements after rerunning an app, so I made a pretty simple python package to automatically do this. Just put this together recently so it is by no means production ready. You can call all of the status elements (toast, success, balloons…) the same way as with streamlit, but rather than displaying them immediately, they are only shown upon refresh by stn.notify_all()
.
Check out the github repo for more info, Github: GitHub - pgarrett-scripps/Streamlit_Notify: Displays Streamlit Status Elements after rerun
Currently it supports the following elements:
st.toast
st.balloons
st.snow
st.success
st.info
st.error
st.warning
:st.exception
Installing:
pip install streamlit-notify
Basic Usage:
import streamlit as st
import streamlit_notify as stn
# Display all queued notifications at the beginning of your app. This will also clear the list.
stn.notify_all()
# Add a notification that will be displayed on the next rerun
if st.button("Show Toast"):
stn.toast("This is a toast message", icon="✅")
st.rerun()
if st.button("Show Balloons"):
stn.balloons()
st.rerun()
if st.button("Show Success Message"):
stn.success("Operation successful!")
st.rerun()