Changing "pages" with the click of a button

My streamlit app starts on the “About” section where details are given about to use the app.
I created another “page” where I want to display figures and plots. Both “pages” can be selected using a simple selectbox.
I would like that when clicking on a specific button, the app switch to the second “page”. Is there any way to do that?

import streamlit as st

page = st.selectbox('Page', ('About', 'Plot'), 0)

if page == 'About':
    st.info('test')

button = st.button('button')
if button:
    page = 'Plot'  # does not work
1 Like

Are you trying to accomplish pagination?
Example of what I mean:

So here you just have several list items generated( in your case it may be plots)

Hi @conic,

I don’t need to keep all the plots in different pages.
Once the button is clicked, the last plot is replaced by the new plot in the “Plot” page (hope that makes sense).
Basically, if you run the code of my post, I would like that the selectbox switch to ‘Plot’ when the button is clicked.

Hi. Have you found an answer to your question?