You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Has anyone found a way to show a spinner when running the search function? For example, I make API calls that can sometimes take 3-4 seconds to return results and I would like to be able to show a spinner of some sort in the UI.
The text was updated successfully, but these errors were encountered:
Hey, you could add the spinner to the search function itself, maybe with a placeholder depending on where you'd like to indicate it running?
import time
import streamlit as st
from streamlit_searchbox import st_searchbox
def search(searchterm: str) -> list[str]:
with placeholder:
with st.spinner("Searching..."):
time.sleep(5)
return [f"{searchterm}-{i}" for i in range(10)]
placeholder = st.empty()
st.title("Searchbox test")
st_searchbox(search)
Has anyone found a way to show a spinner when running the search function? For example, I make API calls that can sometimes take 3-4 seconds to return results and I would like to be able to show a spinner of some sort in the UI.
The text was updated successfully, but these errors were encountered: