Streamlit Expander

Learn to control visual display with the expander widget in Streamlit.

Control visual display

Streamlit offers yet another way to help our application users to control what’s displayed to them.

This is similar to how we use st.checkbox() in a previous lesson to show additional material controlled by users.

Executing the example

The code below shows how we can use st.expander() to give users control over what they see. Let’s run the code to see it in action:

Get hands-on with 1200+ tech skills courses.