Hi ,
I have 2 pages main.py and sample.py
I want to make a button in main.py so it can navigate to sample.py.
Hi ,
I have 2 pages main.py and sample.py
I want to make a button in main.py so it can navigate to sample.py.
You can call switch_page
when the button is pressed. You may be interested in page_link
too.
Hi , I dont want main and display to be present in sidebar. so the main.py is main page there is one button submit , when I click on it it should go to sample.py and display it. I tried both but it is giving me side bar also, which I don’t want. Is there any way ?
You can use the switch page feature and hide the sidebar simultaneously, hence the only way to access the other page is through the button. You can refer to the following,
I dont want to completely hide my side bar as it contain more things… Is it possible to hide certain things from side bar
For that you have the configuration option client.showSidebarNavigation
sorry I am not getting this
Whether to show the pages navigation menu in the sidebar is a configuration option that defaults to true
. You can set it to false
in the command line when you run the script:
streamlit run main.py --client.showSidebarNavigation false
You can also use environment variables or a configuration file as explained in the docs:
Let me know if there is something that you don’t understand.
both main.py and sample.py is a streamlit code so when I am using switch_page or page_link sample.py is not getting displayed
It works for me. You must be doing something different.
Your sample.py should be inside the pages folder for it to work.
Hi @Ritushree_Pagare if I got it correct may be you are looking something page redirect.
You can try st.link_button this will allow you to open new page on click.
Thanks
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
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.
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.
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.
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.