Streamlit Placeholders

Learn to use placeholders in Streamlit.

Transitory elements

We may need our application to have transitory elements in it. Streamlit provides the st.empty() method that sets up placeholders for such elements.

An example could be a countdown timer that’s active only when a certain activity is being processed. Once it’s completed, the timer is cleared up.

Let’s run the code below to see how st.empty() is used with transitory elements:

Get hands-on with 1400+ tech skills courses.