I want to hide the stSidebarNav, here is the code:
import streamlit as st
from st_pages import Page, show_pages, hide_pages
def main():
# st.set_page_config(initial_sidebar_state="collapsed")
st.markdown(
f"""
<style>
[data-testid="stSidebarNav"] {{
background-repeat: no-repeat;
height:0px;
visibility:hidden;
}}
</style>
""",
unsafe_allow_html=True,
)
show_pages([
Page("streamlit_app.py","test"),
Page("function-demo/multi-pages/MyPages/main.py","main"),
Page("function-demo/multi-pages/MyPages/page1.py","intro"),
Page("function-demo/multi-pages/MyPages/page2.py","trial")
])
st.write("In Page test")
And it can hide the stSidebarNav.
But when refreshing the page, the Navigation bar will still show for a few seconds, and then disappear automatically.
How to make this “show second” disappear?