st.expander expanded/collapsed state
See original GitHub issueProblem
I’d like to be able to know whether a st.expander
is expanded or collapsed (e.g. to show something on the main layout only when an expander in the sidebar is in expanded state).
Solution
MVP: Something like st.expander().expanded
as a bool
would be nice.
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.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:8
Top Results From Across the Web
st.expander - Streamlit Docs
Inserts a container into your app that can be used to hold multiple elements and can be expanded or collapsed by the user....
Read more >How to add an expandable container in Streamlit - ProjectPro
You can add multi-element containers that can be expanded or collapsed in Streamlit. This can be done using "st.expander".
Read more >Status of State Medicaid Expansion Decisions: Interactive Map
The Affordable Care Act's (ACA) Medicaid expansion expanded Medicaid coverage to nearly all adults with incomes up to 138% of the Federal ...
Read more >How do you keep Streamlit widgets from getting reset when I ...
It seems to now work for streamlit>=1.8.0 : Parameters' state is now saved. Of course, it also works with the st.expander too.
Read more >Parking Expansion - State Center Community College District
Between the surface level lots and the garage, there will be 986 stalls. Landscaping is nearly done. The offsite street work on Blackstone...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Would like to see this. I want to hide charts etc not in use which are quite processor intensive and only run the code when the expander is expanded. Something like:
At the moment, everything is run, even in the hidden content.
Could also be included as an attribute for the expander:
(Psuedo-code, but you get the idea 😉)
Getting expander state is a must especially when I need to monitor if users visit the content inside, looking forward to seeing an update!