franekp / streamlit-permalink

MIT License
39 stars 2 forks source link

Is st.empty() possible? #4

Closed thomas-happify closed 9 months ago

thomas-happify commented 1 year ago

First off, this is a really awesome helper library! thanks a lot for doing this.

I'm wondering if stp.empty() is possible? because sometimes I want to have a placeholder to arrange the streamlit UI.

Thanks!

franekp commented 9 months ago

Yes, using st.empty() just works. The reason there is stp.form() but not stp.empty(), stp.container(), etc. is because forms behave differently and update their state only when submit button is pressed, so the logic for updating the url must be tied to the submit button and not individual components.

I have added a catch-all __getattr__ such that stp.empty(), stp.container(), etc. just forward to the st namespace.