| Function signature[source] | |
|---|---|
st.spinner(text="In progress...", *, show_time=False, width="content") | |
| Parameters | |
text (str) | The text to display next to the spinner. This defaults to "In progress...". The text can optionally contain GitHub-flavored Markdown. Syntax information can be found at: https://github.github.com/gfm. See the body parameter of st.markdown for additional, supported Markdown directives. |
show_time (bool) | Whether to show the elapsed time next to the spinner text. If this is False (default), no time is displayed. If this is True, elapsed time is displayed with a precision of 0.1 seconds. The time format is not configurable. |
width ("content", "stretch", or int) | The width of the spinner element. This can be one of the following:
|
Example
import streamlit as st
import time
with st.spinner("Wait for it...", show_time=True):
time.sleep(5)
st.success("Done!")
st.button("Rerun")
Still have questions?
Our forums are full of helpful information and Streamlit experts.