Sidebar permanently hidden; cannot be display

Hi, I added a sidebar to my page (which is an interface for a script that i had) It was looking good, and then i notice sidebars come with a built-in hide button, so i press it and i have never seen my sidebar every since. This is a list of the things i have tried (In every attempt i clear cache and restart the page or even the run entirely):

  • st.set_page_config(  layout="wide",  initial_sidebar_state="expanded"\ )
    
  • search & deleted every “hidden” in my css

  • drag the mouse while clicking all over the left side of the screen hoping to find an invisible arrow

  • st.set_page_config(initial_sidebar_state="expanded")
    
  • overflow-y: hidden; 
    

I don’t really know what to do. Every line of thinking I want to explore gets invalidaded by the fact that the sidebar was funcional and displaying correctly before i clicked the arrow. This is how it looks rn if it matters:

This is the code of the sidebar:

# main game interface
if st.session_state.game_started:
    # check if game is over
    if st.session_state.game.valid_rounds >= st.session_state.game.rounds:
        col_left, col_center, col_right = st.columns([1, 2, 1])
        with st.sidebar:
            st.markdown("""
            <div class="game-title">Belief / Information</div>
            """, unsafe_allow_html=True)
            counts = st.session_state.bot.moves_count_real if st.session_state.bot else [0, 0, 0]
            df = pd.DataFrame({"Move": [MOVE_NAMES['R'], MOVE_NAMES['P'], MOVE_NAMES['S']], "Count": counts}).set_index("Move")
            st.bar_chart(df, width='stretch')

I use python 3.15.5 and streamlit 1.52.2
Alternative: is there a way to display content of the sides of the screen? I found columns and the overall streamlit to only work in the center

Welcome to the community, and thanks for the detailed question! :blush: If your sidebar disappeared after clicking the hide/collapse arrow and won’t reappear—even after using st.set_page_config(initial_sidebar_state=“expanded”) and clearing cache—it’s likely due to a persistent user setting in your browser’s local storage, not your code. Streamlit remembers the sidebar state per user, so once you collapse it, it stays collapsed until you manually expand it again using the sidebar’s toggle arrow. If the arrow is missing, this could be due to custom CSS or a browser rendering issue.

To restore the sidebar, ensure you haven’t hidden the toggle arrow with CSS (e.g., targeting [data-testid=“collapsedControl”]). If you have, remove or adjust that CSS. If the arrow is still missing, try a different browser or clear your browser’s local storage for localhost. For alternative layouts, Streamlit’s st.columns allows you to place content on the sides, but true sidebars with toggle functionality are only available via st.sidebar. For more, see the Streamlit sidebar docs.

Sources:

Slightly, simpler: Try running your app with st.set_page_config(initial_sidebar_state="collapsed")then edit it to expanded, save, and rerun. This will force the frontend to toggle the state because if it doesn’t cycle through a different initial state, it won’t reset whatever frontend state is saved.

Now, as for not seeing the arrow to re-expand; that is weird. If you run a new app on the same port in the same browser (but no CSS or anything exotic), is the sidebar button still hidden?