Using callbacks and session states should be able to achieve that behavior. Here is an example.
import streamlit as st
if "is_logged_in" not in st.session_state:
st.session_state["is_logged_in"] = False
def login():
if "btn_login" in st.session_state:
st.session_state["is_logged_in"] = True
if not st.session_state["is_logged_in"]:
st.button("Login", key="btn_login", on_click=login)
else:
st.write("Logged in!")
thank you so much for your answer. You are absolutely correct, that this solves the problem. The question went more in the direction on how Streamlit supports manipulating DOM Elements.
Thanks for your time and have a great day.
br, Günther