Toggle, hide sidebar

Hi.

After select some options on the sidebar of my app, I have a button to make the prediction.

I would like to know if is there a way to toggle/hide the sidebar?

On mobile, that gets in the way of usability.

Thanks.

Hey @Racchel!

Assuming I understood your question the solution is very easy. When you have the sidebar open there is a little “X” in the top right hand corner, this will collapse the sidebar so you can use the rest of your app! I attached a picture of what this looks like on a phone.

If you need to (or want to) open the sidebar again, there is an arrow in the top left corner after you have collapsed it that allows you to re-open the side bar.

Hopefully I have not misunderstood and this helps!
Happy Streamlit-ing!
Marisa

1 Like