Insert a multi-element container that can be expanded/collapsed.
Function signature

st.expander(label: str, expanded: bool = False)


label (str)

A string to use as the header for the expander.

expanded (bool)

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

Was this page helpful?


Still have questions?

Our forums are full of helpful information and Streamlit experts.