Streamlit Expander

This enables you to give users the option to view additional material. This is similar to how we used the st.checkbox() in an if statement to show additional material.

df = pd.DataFrame({“Insect”:[“Lacewing”, “Locust”, “Ladybird”, “Leafhopper”], “Count”: [3,5,1,2]}) st.dataframe(df) with st.expander(“Click to see examples of insects”): st.image(“https://bit.ly/quartets3”)

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy