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
st.tabs: know and control state #6004
Comments
|
Thanks for sharing this, @MathCatsAnd! It's a great idea. |
|
+1 |
4 similar comments
|
+1 |
|
+1 |
|
+1 |
|
+1 |
|
actually a tab selector that returns the state is just a differently styled horizontal st.radio, the mechanics underneath should be 100% the same, I'd expect that it should be relatively straight forward |
|
+1 |
2 similar comments
|
+1 |
|
+1 |
|
+1 |
|
+1 |
2 similar comments
|
+1 |
|
+1 |
|
This would add so much to Streamlit! It boggles my mind that this is not possible. It must be that this is very difficult to achieve. It is hard for me to imagine why this would be the case. |
|
+1 |
2 similar comments
|
+1 |
|
+1 |
UpdateHey all! We definitely want to have this but didn't start working on it yet. We're currently trying to figure out a general API that lets us handle events. This is primarily for events like selecting a data point in a chart or a row in a dataframe but ideally, we can also extend it to control tab changes later on. See also my comment here. Will update here once we start working on this issue! |
|
+1 |
|
Some sort of current tab would be great, right now I'm 99% sure they are all rendering/executing regardless of whether you are looking at it, but with a 'get current tab' tracking, you could run when only on "selected". In my case, would greatly improve speed. |
|
Yes please |
|
I'd like to control the default/selected tab. |
Problem
st.tabs is purely an organizational element with no access to know or control its state.
Solution
Add an option (or new component) to make st.tabs an element that communicates with the backend to know and control state.
Additional context
This is related to #5321 but a more robust feature request.
There is an ongoing thread in the forums on this topic. I'm creating this feature request for votes to be recorded.
https://discuss.streamlit.io/t/st-tabs-is-it-possible-to-do-any-of-the-following-access-an-st-tab-click-event-set-a-default-selected-tab-on-a-page/29341
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.
The text was updated successfully, but these errors were encountered: