# How to keep a button activate?

**URL:** <https://discuss.streamlit.io/t/how-to-keep-a-button-activate/17437>\
**Category:** Using Streamlit\
**Created:** [September 23, 2021, 9:28am UTC](https://discuss.streamlit.io/t/how-to-keep-a-button-activate/17437 "2021-09-23T09:28:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![asehmi](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/asehmi/32/1771_2.png) [@asehmi](https://discuss.streamlit.io/u/asehmi)\
**Post date:** [September 23, 2021, 10:55am UTC](https://discuss.streamlit.io/t/how-to-keep-a-button-activate/17437/2 "2021-09-23T10:55:57Z")

</div>

@doll

Buttons set their value to `True` only **in the instant they are clicked**. After that, their value goes back to `False`.

In your use case you would be advised to use `st.radio`. Radio buttons lay out vertically, so that might not suit you. So, instead use `st.checkbox` in multiple columns. Then set and hold the value state of the checkboxes in `st.session_state`.

See [“multi-page-app-with-session-state”](https://discuss.streamlit.io/t/multi-page-app-with-session-state/3074) for inspiration. If you want the page to reset, then use `st.experimental_rerun` to run the app from the top but still preserving the set states.

HTH,  
Arvindra

---

_[View the full topic](https://discuss.streamlit.io/t/how-to-keep-a-button-activate/17437)._
