Page refresh is slow and ugly

I vote for the kitty! :black_cat:


Have you tried using st.empty? By your description, I am assuming you have a single script providing your pages instead of using the built-in multipage functionality. The ghosting of widgets is something Streamlit does while waiting to see if it those widgets are going to be kept or discarded. If you have each page in a container within an empty element, you could have a means to tell Streamlit to just throw everything away and not wait.

import streamlit as st
import time

page_selection = st.selectbox('Page', ['A','B','C'])
page_container = st.empty()

def content(page):
    page_container.empty()
    time.sleep(.2) # A hack to make the empty stick.
    body = page_container.container()
    with body:
        with st.spinner():
            time.sleep(5)
        st.write(page)

content(page_selection)