Session State and Widget State association
Every widget with a key is automatically added to Session State:
```python
st.text_input("Your name", key="name")
This exists now:
st.session_state.name
```
Use Callbacks to update Session State
A callback is a python function which gets called when an input widget changes.
Order of execution: When updating Session state in response to events, a callback function gets executed first, and then the app is executed from top to bottom.
Callbacks can be used with widgets using the parameters on_change (or on_click), args, and kwargs:
Parameters
on_change or on_click - The function name to be used as a callback
args (tuple) - List of arguments to be passed to the callback function
kwargs (dict) - Named arguments to be passed to the callback function
Widgets which support the on_change event:
