The following is the documentation example from the st.navigation:
import streamlit as st
def page1():
st.write(st.session_state.foo)
def page2():
st.write(st.session_state.bar)
# Widgets shared by all the pages
st.sidebar.selectbox("Foo", ["A", "B", "C"], key="foo")
st.sidebar.checkbox("Bar", key="bar")
pg = st.navigation([page1, page2])
pg.run()
You can see that despite the fact that selectbox and checkbox are called before the st.navigation and pg.run they still display below the menu.
How can we control the order of appearance?