st.balloons() in Streamlit
The balloons method is a fun visual animation in Streamlit that shows colorful balloons floating up the screen.
Itโs often used to celebrate a successful event, such as:
- Model training completion
- File upload success
- Data processing done
- Quiz completion
Syntax
st.balloons()
It takes no parameters โ it simply triggers the animation.
Example: Basic example.
Python
import streamlit as st
import time
st.title("๐ Balloons Example")
# Simulate a task
st.write("Processing your request...")
time.sleep(2)
# When the task is done
st.success("Task completed successfully!")
st.balloons() # ๐ Celebration effect Explanation
- st.balloons() shows an animation of balloons floating upward.
- It doesnโt return anything โ it is purely a visual effect.
- Great for user feedback and user engagement.