[Python] How in streamlit get screen size?

Discussão em 'Python' iniciado por Stack, Julho 29, 2025.

  1. Stack

    Stack Membro Participativo

    How to get page size in streamlit? Can't find any documentation or examples

    I tried like this:

    from streamlit_js_eval import streamlit_js_eval

    st.write(f"Screen width is {streamlit_js_eval(js_expressions='screen.width', key = 'SCR')}")
    st.write(f"Screen height is {streamlit_js_eval(js_expressions='screen.height', key = 'SCR1')}")


    but this one gives the size of the entire Screen and does not change when the page is changed

    Continue reading...

Compartilhe esta Página