Curious about the on_click/on_change, args and kwargs in Widgets

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!! :wave: :partying_face:

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:

Hope these help :slightly_smiling_face:

Happy Streamlit’ing! :balloon:

1 Like

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!

1 Like