DocumentationsearchSearchrocket_launchGet startedInstallationaddFundamentalsaddFirst stepsaddcodeDevelopConceptsaddAPI referenceremovePAGE ELEMENTSWrite and magicaddText elementsaddData elementsaddChart elementsaddInput widgetsaddMedia elementsaddLayouts and containersaddChat elementsaddStatus elementsremoveCALLOUTSst.successst.infost.warningst.errorst.exceptionOTHERst.progressst.spinnerst.statusst.toastst.balloonsst.snowThird-party componentsopen_in_newAPPLICATION LOGICNavigation and pagesaddExecution flowaddCaching and stateaddConnections and secretsaddCustom componentsaddUtilitiesaddConfigurationaddTOOLSApp testingaddCommand lineaddTutorialsaddQuick referenceaddweb_assetDeployConceptsaddStreamlit Community CloudaddStreamlit in Snowflakeopen_in_newOther platformsaddschoolKnowledge baseFAQInstalling dependenciesDeployment issuesHome/Develop/API reference/Status elements/st.statusst.statusStreamlit VersionVersion 1.34.0Version 1.33.0Version 1.32.0Version 1.31.0Version 1.30.0Version 1.29.0Version 1.28.0Version 1.27.0Version 1.26.0Version 1.25.0Version 1.24.0Version 1.23.0Version 1.22.0Version 1.21.0Version 1.20.0Version 1.19.0Version 1.18.0Version 1.17.0Version 1.16.0Version 1.15.0Version 1.14.0Version 1.13.0Streamlit in SnowflakeInsert a status container to display output from long-running tasks.
Inserts a container into your app that is typically used to show the status and
details of a process or task. The container can hold multiple elements and can
be expanded or collapsed by the user similar to st.expander.
When collapsed, all that is visible is the status icon and label.
The label, state, and expanded state can all be updated by calling .update()
on the returned object. To add elements to the returned container, you can
use with notation (preferred) or just call methods directly on the returned
object.
By default, st.status() initializes in the "running" state. When called using
with notation, it automatically updates to the "complete" state at the end
of the "with" block. See examples below for more details.
Function signature[source] st.status(label, *, expanded=False, state="running") Parameters

label
(str)

 
The initial label of the status container. The label can optionally
contain Markdown and supports the following elements: Bold,
Italics, Strikethroughs, Inline Code, Emojis, and Links.
This also supports:

Emoji shortcodes, such as :+1:  and :sunglasses:.
For a list of all supported codes,
see https://share.streamlit.io/streamlit/emoji-shortcodes.
LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"
must be on their own lines). Supported LaTeX functions are listed
at https://katex.org/docs/supported.html.
Colored text and background colors for text, using the syntax
:color[text to be colored] and :color-background[text to be colored],
respectively. color must be replaced with any of the following
supported colors: blue, green, orange, red, violet, gray/grey, rainbow.
For example, you can use :orange[your text here] or
:blue-background[your text here].

Unsupported elements are unwrapped so only their children (text contents)
render. Display unsupported elements as literal characters by
backslash-escaping them. E.g. 1\. Not an ordered list.


expanded
(bool)

 
If True, initializes the status container in "expanded" state. Defaults to
False (collapsed).


state
("running", "complete", or "error")

 
The initial state of the status container which determines which icon is
shown:

running (default): A spinner icon is shown.
complete: A checkmark icon is shown.
error: An error icon is shown.

Returns(StatusContainer)  A mutable status container that can hold multiple elements. The label, state,
and expanded state can be updated after creation via .update().
Examples
You can use the with notation to insert any element into an status container:

import time
import streamlit as st

with st.status("Downloading data..."):
    st.write("Searching for data...")
    time.sleep(2)
    st.write("Found URL.")
    time.sleep(1)
    st.write("Downloading data...")
    time.sleep(1)

st.button("Rerun")

Built with Streamlit 🎈Fullscreen open_in_new
You can also use .update() on the container to change the label, state,
or expanded state:

import time
import streamlit as st

with st.status("Downloading data...", expanded=True) as status:
    st.write("Searching for data...")
    time.sleep(2)
    st.write("Found URL.")
    time.sleep(1)
    st.write("Downloading data...")
    time.sleep(1)
    status.update(label="Download complete!", state="complete", expanded=False)

st.button("Rerun")

Built with Streamlit 🎈Fullscreen open_in_new


StatusContainer.updateStreamlit VersionVersion 1.34.0Version 1.33.0Version 1.32.0Version 1.31.0Version 1.30.0Version 1.29.0Version 1.28.0Version 1.27.0Version 1.26.0Version 1.25.0Version 1.24.0Version 1.23.0Version 1.22.0Version 1.21.0Version 1.20.0Version 1.19.0Version 1.18.0Version 1.17.0Version 1.16.0Version 1.15.0Version 1.14.0Version 1.13.0Streamlit in SnowflakeUpdate the status container.
Only specified arguments are updated. Container contents and unspecified
arguments remain unchanged.
Function signature[source] StatusContainer.update(*, label=None, expanded=None, state=None) Parameters

label
(str or None)

 
A new label of the status container. If None, the label is not
changed.


expanded
(bool or None)

 
The new expanded state of the status container. If None,
the expanded state is not changed.


state
("running", "complete", "error", or None)

 
The new state of the status container. This mainly changes the
icon. If None, the state is not changed.
Previous: st.spinnerNext: st.toastforumStill have questions?Our forums are full of helpful information and Streamlit experts.HomeContact UsCommunity© 2024 Snowflake Inc.Cookie policy