Could we let st.form area be folded after st.form_submit_button be clicked?

st.form is a very good component, it provides us an area to fill with st.text_input or st.selectbox etc.
in some cases, if we put a lot of content between st.form and st.form_submit_button, we want to make space layout become more concise and crisp by folding the content between st.form and st.form_submit_button after button be clicked.

hope this will become a new function inside the st.form in the near future.

my advice, add an argument like this:

st.form_submit_button("click me to submit", fold_after_click=True)

Hey @BeyondMyself,

We don’t currently have any way to get this behaviour, but please go to our GitHub issues where you can choose to request a new feature (feature request option) and fill that out!

We are very open to hearing from the community on what they would like to see in updates and new features, so if yours gets a lot of likes and support the team may choose to prioritize your suggestion!

Happy Streamlit-ing!

OK, I have posted a new feature, here is the link

1 Like