Multipagination sidebar

Hello am new to Streamlit and trying to use the multipagination set-up from this doc: Creating multipage apps using the `pages/` directory - Streamlit Docs.
I have a quick question about the sidebar that appears in multipagination; I am using the sidebar for other purposes:

  • I want the sidebar in the home page but without the component that shows the list of pages.
  • In another page i added, i dont want the sidebar. Currently in that page there is no st.sidebar but it appears because of the multipagination.

Is there a default way to hide the sidebar when using multipagination?

Under your working or app folder, create a folder named .streamlit. Under .streamlit folder create a file named config.toml. In config.toml file write the following.

[client]
showSidebarNavigation = false

You can create a page_link to navigate to other pages.

import streamlit as st


with st.sidebar:
    st.page_link('pages/basketball.py', label='Basketball', icon='πŸ€')

st.header('Home')

In another page say basketball do not add a sidebar widgets, but you can add a page_link navigation button to return back to the home page.

import streamlit as st


st.page_link('main.py', label='Home', icon='πŸ†')

st.header('Basketball')
1 Like

thanks @ferdy

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.