Streamlit offers various functions to display progress bars and status messages, such as success, errors, and information. These features make your applications more dynamic and interactive.

Functions for Progress and Visual Feedback

st.balloons()

Displays balloons on the screen as a form of celebration.

import streamlit as st

st.write('Congratulations! You have completed the task.')
st.balloons()

st.progress()

Displays a progress bar to indicate task progress.

import streamlit as st
import time

progress = st.progress(0)
for percent in range(101):
    time.sleep(0.05)
    progress.progress(percent)
st.write('Task completed!')

st.spinner()

Displays a temporary waiting message while processes are running.

import streamlit as st
import time

with st.spinner('Processing, please wait...'):
    time.sleep(5)  # Simulating a delay
st.success('Process successfully completed!')

Functions for Status Messages

st.success()

Displays a message indicating success.

st.success('Registration successfully completed!')

st.error()

Displays an error message.

st.error('Error connecting to the database.')

st.warning()

Displays a warning message.

st.warning('Storage space is almost full.')

st.info()

Displays an informational message.

st.info('Today is the last day to register.')

st.exception()

Displays an exception captured in the code.

try:
    1 / 0
except ZeroDivisionError as e:
    st.exception(e)

With these functions, you can create more interactive applications and provide clear visual feedback to your users.