I need to change page page depending on a variable value.
For example if x = 1 it will change the app to another page.
I can do it with button I know but I need it to be automatically without button.
Thanks in advance
You can do with with streamlit-extras
import streamlit as st
from streamlit_extras.switch_page_button import switch_page
x = st.slider("x", 0, 10)
if x == 1:
switch_page("page1")
Is there any documentation of how to make the second page?
If you create a pages
folder next to your main_app.py
file, then any .py
file in the pages folder will be another page.
Hey @Abdelrahman_Mahmoud Abdel,
Just wanted to update that with release 1.30.0 you can now natively program page switching using st.switch_page()
as well as disable the sidebar navigation.
More info in the docs . Looking forward to hearing what you think!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.