Create a button component where each button press works to toggle the status of the button on and off (as a bonus, could even change the color or something to show the current state).
from streamlit_extras.stateful_button import button
if button("Button1"):
if button("Button2"):
if button("Button3"):
st.write("Button3")
Create a button component where each button press works to toggle the status of the button on and off (as a bonus, could even change the color or something to show the current state).
Right now you can make this work through some fiddling with session state, but it's a fairly manual process https://discuss.streamlit.io/t/3-nested-buttons/30468/2?u=blackary
Simple prototype, without coloring: https://playground.streamlit.app/?q=stateful_button