最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - How to open pop up (st.dialog) after clicking html button in st.markdown? - Stack Overflow

programmeradmin1浏览0评论

I am developping streamlit web application.

The functionality I want to add is :

When I click the button, I want to show the pop up button

Here is the code I did :

import streamlit as st

st.title("TEST JS & HTML IN STREAMLIT")
st.caption('A live demo')

# Navbar Component
st.markdown(f"""

    <div class="navbar-buttons">
        <a href="#" class="navbar-text">POP UP BUTTON</a>
    </div>


""", unsafe_allow_html=True)

@st.dialog("POP UP WINDOW")
def show_rgpd_popup():
    st.write("""
    This is pop up window
    """)

if True :
    show_rgpd_popup()

I have to keep st.markdown to use html component (st.button or st.navbar I do not want to use)

But I cannot find a proper solution to realize this functionality.

Can you help me ?

发布评论

评论列表(0)

  1. 暂无评论