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

st.tabs: know and control state #6004

Open
MathCatsAnd opened this issue Jan 23, 2023 · 23 comments
Open

st.tabs: know and control state #6004

MathCatsAnd opened this issue Jan 23, 2023 · 23 comments
Labels
feature:st.tabs status:likely Will probably implement but no timeline yet type:enhancement Requests for feature enhancements or new features

Comments

@MathCatsAnd
Copy link
Contributor

MathCatsAnd commented Jan 23, 2023

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.

@MathCatsAnd MathCatsAnd added the type:enhancement Requests for feature enhancements or new features label Jan 23, 2023
@carolinedlu
Copy link
Collaborator

Thanks for sharing this, @MathCatsAnd! It's a great idea.

@ZA89676
Copy link

ZA89676 commented Feb 3, 2023

+1

4 similar comments
@domjulen
Copy link

domjulen commented Feb 5, 2023

+1

@borizak
Copy link

borizak commented Feb 5, 2023

+1

@marcotielen
Copy link

+1

@elliott-fogg
Copy link

+1

@gergelyhunyady
Copy link

gergelyhunyady commented Mar 28, 2023

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

@korayt
Copy link

korayt commented Apr 11, 2023

+1

2 similar comments
@makhai88
Copy link

+1

@mkleinbort-ic
Copy link

+1

@sfc-gh-jrieke sfc-gh-jrieke added the status:likely Will probably implement but no timeline yet label Jun 8, 2023
@bscuba
Copy link

bscuba commented Aug 3, 2023

+1

@barweiss45
Copy link

+1

2 similar comments
@gallanik
Copy link

+1

@NickA-ki
Copy link

NickA-ki commented Sep 1, 2023

+1

@stepsbystep
Copy link

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.

@codiesee
Copy link

+1

2 similar comments
@DrBenjamin
Copy link

+1

@FaustinoGaskin1
Copy link

+1

@jrieke
Copy link
Collaborator

jrieke commented Nov 14, 2023

Update

Hey 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!

@DataAnalyst4321
Copy link

+1

@Codie-Petersen
Copy link

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.

@Odrec
Copy link

Odrec commented Dec 31, 2023

Yes please

@whitford-olmst
Copy link

I'd like to control the default/selected tab.

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

No branches or pull requests