Display progress and status

Streamlit provides a few methods that allow you to add animation to your apps. These animations include progress bars, status messages (like warnings), and celebratory balloons.

screenshot

Progress bar

Display a progress bar.

for i in range(101):
  st.progress(i)
  do_something_slow()
screenshot

Spinner

Temporarily displays a message while executing a block of code.

with st.spinner("Please wait..."):
  do_something_slow()
screenshot

Balloons

Display celebratory balloons!

do_something()

# Celebrate when all done!
st.balloons()
screenshot

Snowflakes

Display celebratory snowflakes!

do_something()

# Celebrate when all done!
st.snow()
screenshot

Error box

Display error message.

st.error("We encountered an error")
screenshot

Warning box

Display warning message.

st.warning("Unable to fetch image. Skipping...")
screenshot

Info box

Display an informational message.

st.info("Dataset is updated every day at midnight.")
screenshot

Success box

Display a success message.

st.success("Match found!")
screenshot

Exception output

Display an exception.

e = RuntimeError("This is an exception of type RuntimeError")
st.exception(e)

Third-party components

These are featured components created by our lovely community. If you don't see what you're looking for, check out our Components Hub app and Streamlit Extras for more examples and inspiration!

screenshot

Stqdm

The simplest way to handle a progress bar in streamlit app. Created by @Wirg.

from stqdm import stqdm

for _ in stqdm(range(50)):
    sleep(0.5)
screenshot

Custom notification box

A custom notification box with the ability to close it out. Created by @Socvest.

from streamlit_custom_notification_box import custom_notification_box

styles = {'material-icons':{'color': 'red'}, 'text-icon-link-close-container': {'box-shadow': '#3896de 0px 4px'}, 'notification-text': {'':''}, 'close-button':{'':''}, 'link':{'':''}}
custom_notification_box(icon='info', textDisplay='We are almost done with your registration...', externalLink='more info', url='#', styles=styles, key="foo")
screenshot

Streamlit Extras

A library with useful Streamlit extras. Created by @arnaudmiribel.

from streamlit_extras.let_it_rain import rain

rain(emoji="ğŸŽˆ", font_size=54,
  falling_speed=5, animation_length="infinite",)

Was this page helpful?

editSuggest edits
forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.