Creation of a new Page

Hello All,

is there way we can create a new Page with a button click using Streamlit?

As of now I could keep on increasing my page’s length by keeping on adding widgets, but I want them to a new page.

Thanks in Advance.

Hey @Harish_Kodarapu,

You can do this with the command in streamlit. Ideally you would use this because it preserves the state of the radio button no matter what you do on each page (click buttons, display data etc…)

import streamlit as st
my_page ='Page Navigation', ['page 1', 'page 2'])

if my_page == 'page 1':
    st.title('here is a page')
    button = st.button('a button')
    if button:
    st.title('this is a different page')
    slide = st.slider('this is a slider')

for the first page:

for the second page:

Happy Streamlit-ing!