I have a Logout button in the sidebar. I want to hide/disappear the complete sidebar when I click the Logout button. This my code
import streamlit as st
name, authentication_status, username = authenticator.login("Login","main")
if authenticator.logout("Logout", "sidebar"):
st.markdown("""
<style>
[data-testid="collapsedControl"] {
display: none
}
</style>
""", unsafe_allow_html=True)
I tried this Completely disable sidebar?. But it doesn't work.
I expect this markdown to solve your problem.
st.markdown("""
<style>
section[data-testid="stSidebar"][aria-expanded="true"]{
display: none;
}
</style>
""", unsafe_allow_html=True)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With