Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
KeeonTabrizi opened this issue Oct 8, 2022 · 1 comment
Open

Comments

@KeeonTabrizi
Copy link

KeeonTabrizi commented Oct 8, 2022

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'

@tonkolviktor
Copy link

tonkolviktor commented Jun 14, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants