On_click for links/hyperlinks; session_state preservation for complex apps

I’m looking for a way to use hyperlinks to navigate through a more complex app without losing session (state). It is possible with a st.button and the on_click parameter, but buttons look very ugly in the middle of text or as headers of an item. Is there a way to create a hyperlink with an on_change behavior?

Hi @hoop_snake

You can look into using the st.experimental_get_query_params() (st.experimental_get_query_params<!-- --> - Streamlit Docs) and st.experimental_set_query_params() (st.experimental_set_query_params<!-- --> - Streamlit Docs) methods to get and set parameters via URL.

Hope this helps!

We’re already making heavy use of set and get query params. Calling those causes a new session (thus loss of current session) as well, UNLESS called from an on_click or on_change function. So it would be really helpful for building apps if we could create hyperlinks (and perhaps svg’s) with an on_click action to create a real web experience.