Hide/collapse/fold a section

Is it possible to fold a section and all its nested sections, items, plots etc.?


Sort of. You can use a st.checkbox. If it’s checked you run the code otherwise not.

1 Like

This approach I already used, but I was wondering whether there’s something more canonical.


At the moment I’d say @Marc’s comment reflects the state of Streamlit as a whole: You can use widgets to trigger running one section of code, which means you could potentially use a multiselect or even a slider, theoretically speaking.

At the moment we don’t have anything that fully speaks to the idea of controls that hide/show particular widgets.

I’ve made a feature request for show/hide controls here.

1 Like