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

Tabs hidden when titles exceed the content area width (no ability to scroll) #5552

Open
blipk opened this issue Oct 16, 2022 · 5 comments
Open
Labels
feature:st.tabs type:enhancement Requests for feature enhancements or new features

Comments

@blipk
Copy link

blipk commented Oct 16, 2022

Summary

If you have too many tabs, or even a couple with long titles, and their total width exceeds the main area with, the latter ones become inaccessible.

There should be an ability to scroll through them, perhaps just some small arrows at each end.

Steps to reproduce

Open in Streamlit Cloud

Code snippet:

tab_names = []
for i in range(100):
  tab_names.append(str(i)*4)

tabs = st.tabs(tab_names)

Expected behavior:

Should be able to scroll the tab bar when tabs exceed the screen width, hiding them is bad UX.

Actual behavior:

My tabs are inaccessible.

Is this a regression?

no

Debug info

  • Streamlit version: streamlit share
  • Python version: 3.10
  • Browser version: Chrome latest

Voting for feature requests

Community voting on feature requests enables the Streamlit team to understand which features are most important to our users.
If you'd like the Streamlit team to prioritize this feature request, please use the 👍 (thumbs up emoji) reaction in response to the initial post.

@blipk blipk added type:bug Something isn't working status:needs-triage Has not been triaged by the Streamlit team labels Oct 16, 2022
@LukasMasuch LukasMasuch added feature:st.tabs status:confirmed Bug has been confirmed by the Streamlit team priority:P2 type:enhancement Requests for feature enhancements or new features and removed status:needs-triage Has not been triaged by the Streamlit team type:bug Something isn't working status:confirmed Bug has been confirmed by the Streamlit team priority:P2 labels Oct 16, 2022
@LukasMasuch
Copy link
Collaborator

LukasMasuch commented Oct 16, 2022

@blipk Thanks for reporting this! There are ways to scroll the tab panel, e.g. via vertical scrolling or via left/right arrow keys. However, I agree that it would make sense to also add a visual button/clue that allows scrolling via a mouse click or maybe drag & drop scrolling.

For other users reading this: please upvote the issue (👍) if you also want to have this implemented!

@blipk
Copy link
Author

blipk commented Oct 17, 2022

Thanks @LukasMasuch

Arrow keys work, but often if the tab names line up with the end right, you can't even see theres any extra ones so may not know.

I tried to scroll, but it doesn't seem to process/recieve the vertical scroll event like you say, it seems the page content is taking it.
My mouse doesn't support horizontally scrolling either, and thats not something really common unless you're dealing with large spreadsheets.

I think some kind of indicator that theres more tabs would be ideal at the least.

@blipk
Copy link
Author

blipk commented Oct 18, 2022

Related to https://github.com/uber/baseweb/issues/4857
Shift + Scrolling seems to work.

Perhaps we could add a baseui endEnhancer to the component? Exposied as an icon= kwarg, I believe st.info() and such uses the same, so should be an easy implementation for at least a minor user ux improvement.

@LukasMasuch

@carolinedlu carolinedlu changed the title Tabs hidden when there titles exceed the content area width - No ability to scroll Tabs hidden when titles exceed the content area width (no ability to scroll) Nov 9, 2022
@steve7734
Copy link

I have the same issue. Another solution would be to spread the tabs control over multiple lines

@jrieke
Copy link
Collaborator

jrieke commented May 30, 2023

#6759 also proposed that we wrap the tabs over multiple lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:st.tabs type:enhancement Requests for feature enhancements or new features
Projects
None yet
Development

No branches or pull requests

5 participants