# Collapsible Streamlit sidebar

**URL:** <https://discuss.huggingface.co/t/collapsible-streamlit-sidebar/27689>\
**Category:** Spaces\
**Created:** [December 12, 2022, 10:29am UTC](https://discuss.huggingface.co/t/collapsible-streamlit-sidebar/27689 "2022-12-12T10:29:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alvarocjob](https://avatars.discourse-cdn.com/v4/letter/a/a9a28c/32.png) [@alvarocjob](https://discuss.huggingface.co/u/alvarocjob)\
**Post date:** [December 12, 2022, 10:29am UTC](https://discuss.huggingface.co/t/collapsible-streamlit-sidebar/27689/1 "2022-12-12T10:29:32Z")

</div>

Hello,

When setting `st.set_page_config(initial_sidebar_state="collapsed")` in your Streamlit app, the sidebar is initially collapsed and the user is able to expand it. However, after expanding it it’s not possible to return to the `collapsed` state, as there is no “X” button as in the local Streamlit app. It would be nice to be able to do this.

Alvaro

---

<div class="post-metadata">

**Author:** ![julien-c](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/julien-c/32/41937_2.png) [@julien-c](https://discuss.huggingface.co/u/julien-c)\
**Post date:** [December 13, 2022, 8:52am UTC](https://discuss.huggingface.co/t/collapsible-streamlit-sidebar/27689/2 "2022-12-13T08:52:09Z")

</div>

cc @cbensimon maybe
