streamlit-option-menu icon indicating copy to clipboard operation
streamlit-option-menu copied to clipboard

Is it possible to have pretty URL paths for option menu items?

Open KeeonTabrizi opened this issue 1 year ago • 1 comments

I'm playing around with the library and I noticed the URLS on mouse over / click are something like

http://localhost:8501/component/streamlit_option_menu.option_menu/index.html?streamlitUrl=http%3A%2F%2Flocalhost%3A8501%2F#

Is there a way to shorten this into something more-readable or less verbose?

e.g.

`http://localhose:8501/abc'

KeeonTabrizi avatar Oct 08 '22 05:10 KeeonTabrizi

it's a workaround and may not be as nice, but what I've ended up using was to introduce an optional query parameter (accessed via st.experimental_get_query_params()). If that's set then I set the option_menu(default_index=...) accordingly.

So I could have urls like: http://host:port?p=page1

As said not the nicest thing, but for now it is good enough for my use-case

tonkolviktor avatar Jun 14 '23 18:06 tonkolviktor