How to use st.link_button() to navigate to a link within the same tab without creating new session?
st.link_button always opens another tab, but depending on what you want to do you might be able to solve the problem with a different solution.
If you’re just trying to switch to a different page, you could use this https://extras.streamlit.app/Switch%20page%20function
If you’re trying to jump to a different part of the page, you can use something like this
st.markdown("<a href='#hello-world'>Go to title</a>", unsafe_allow_html=True)
Each title, and header automatically gets an anchor tag associated with it that you can see by hovering over it and clicking on the ![]()
If you can explain more about your use-case, perhaps I or others can suggest some other options.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
