Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| # Initialize session state | |
| if "show_button" not in st.session_state: | |
| st.session_state.show_button = True | |
| # Function to hide the button | |
| def hide_button(): | |
| st.session_state.show_button = False | |
| st.title("Dynamic Button in Streamlit") | |
| # Conditionally display button | |
| if st.session_state.show_button: | |
| if st.button("Click to Hide"): | |
| hide_button() |