Hey. In my application I have a radio on the sidebar where I can change between different pages (Page 1, Page 2, …). When I am on Page 1 I want to have a next button that directly leads me to Page 2. In my code the Page 2 appears below Page 1, but I want it to be displayed exactly the same way as it would have been selected with the radio bar, as only the Page 2.
import streamlit as st st.session_state.page_select = st.sidebar.radio('Pages', ['Page 1', 'Page 2', 'Page 3']) if st.session_state.page_select == 'Page 1': st.title('Page 1') next = st.button('Go to page 2') if next: st.session_state.page_select = 'Page 2' if st.session_state.page_select == 'Page 2': st.title('Page 2') next2 = st.button('Go to page 3') if next2: st.session_state.page_select = 'Page 3' if st.session_state.page_select == 'Page 3': st.title('Page 3')
Thanks in advance!