So in recent documentations, I see there are new features incorporated into widgets but I could not find examples. I am very curious how I can utilize the new functionality in widgets.
For example:
st.button( β¦, on_click=None , args=None , kwargs=None )
How shall I make the use of on_click, args, and kwargs with buttons?? Any concrete example?
Thanks in advance!
Hi @CJtheSloth, welcome to the Streamlit community!!
Our topic guide on how to Add State to your app has concrete examples that demonstrate how to use the on_click
, args
, and kwargs
parameters with st.button
:
- on_click: Example 2: Session State and Callbacks
- args and kwargs: Example 3: Use
args
andkwargs
in Callbacks
Hope these help
Happy Streamlitβing!
Snehan
Hi @snehankekre,
Thanks for pointing out the examples for me! I did not know that the answer is in that section.
Thank you for your help greatly appreciated!