File size: 386 Bytes
1d9eccd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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()