Sticky sidebar


Is it possible to make the sidebar sticky? In the sense, that it won’t collapse and also that it would hide any content behind it?

Sorry if that’s mentioned in documentation. I haven’t found it. I’ve found another question where a user is actually asking how he can collapse the sidebar. That’s funny because for me the sidebar is collapsed by default and I can’t make it stick permanently.


1 Like

Hi @Konstantin_Miller,

Please do visit this Streamlit app CoViz
You can observe that the sidebar is sticky by default in Streamlit when you visit the Streamlit app that is deployed.

I think Streamlit has provided a collapsible Sidebar as you can just click on the close button to close the Sidebar.

Also, the sidebar will not hide any content behind it as the content is designed to appear at the center of the page. So the content will not be affected by the sidebar.

Happy Streamlit Coding…!!!

Hi @srilakshmi,

Unfortunately, the following app

import streamlit as st
st.sidebar.button('Test button')
st.write('Some text')

loads with a collapsed side bar. And when I unfold it, “Some text” gets hidden behind it.


Excellent App @srilakshmi. Is there a pointer to the source code ?