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:

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