I have a series of checkboxes inside a button. When the button is clicked, then the checkboxes should appear with default selections. Ticking/Unticking the checkboxes, however, does not show on the rerun as the button state is not preserved. Clicking on the button, again leads to same default checkboxes. I need to store these states. Attaching screenshot and code below:
Clicking the checkbox leads to:
Any leads how to make the selections show for the checkboxes?
CODE:
import streamlit as st
if st.button("Click Me!"):
st.checkbox("Option1", value = True, key = "opt1")
st.checkbox("Option2", key = "opt2")
st.checkbox("Option3", key = "opt3")
st.checkbox("Option4", key = "opt4")