I am using Streamlit’s new multi-page feature for an application.
I have a script in my ‘/Pages’ folder which I want to use but do not want it to be shown in the item menu.
Is there a solution to hide a specific page from the items menu but for it to still exist? I would like to access it using a button.
Currently, all scripts in the /pages directory are assumed to be pages, and they will be displayed in the item menu. If you want to access pages with st.button, there’s this switch_page available in streamlit-extras (see demo here)
Can I ask you more on your use-case? Curious to know why you’d like to have this functionality.
Hi @arnaud,
Thank you very much for your response.
switch_page is a great tool but unfortunately it doesn’t solve my problem.
I have a different page which consists of a huge DataFrame which is to be used by the user only to provide help to fill a text box on the main page. (for example, if I have to enter a key on the main page in a text box, this other page consists of various keys with their values. The user should be able to press this button, get all the values in the dataframe in a different tab and choose the value to reference it by its key)
Hence, I would like to open this page using a button(in a new tab as I do not want to disturb the progress on the main page) and there’s no point in displaying this all the time in the items menu.
@nishantseh I understand your point. You’re looking for “optional” content. Currently, pages are not optional unfortunately. But you can also take advantage of other layout primitives like:
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.