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.