Multipage - Hiding a page from the items menu

Hi,

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.

Thanks,
Nishant

Hey @nishantseth,

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.

Thanks again,
Nishant

@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:

Hope that helps,

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