Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
streamlit>=1.54.0
streamlit>=1.55.0
webvtt-py
2 changes: 1 addition & 1 deletion python/api-examples-source/guides/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
streamlit>=1.54.0
streamlit>=1.55.0
2 changes: 1 addition & 1 deletion python/api-examples-source/hello/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ pandas==1.5.3
numpy==1.23.5
altair==4.2.0
pydeck==0.8.0
streamlit>=1.54.0
streamlit>=1.55.0
12 changes: 12 additions & 0 deletions python/api-examples-source/layout.expander-callback.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import streamlit as st


def on_expander_change():
if st.session_state.summary:
st.toast("You opened the expander.")
else:
st.toast("You closed the expander.")


with st.expander("Open expander", on_change=on_expander_change, key="summary"):
st.write("This is the expander")
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import streamlit as st

summary = st.expander("Summary", on_change="rerun")
with summary:
st.write("This is the summary")

st.write(
f"The expander is {':green[open]' if summary.open else ':red[closed]'}."
)
10 changes: 10 additions & 0 deletions python/api-examples-source/layout.expander-lazy-load.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import streamlit as st
import time

summary = st.expander("Summary", on_change="rerun")

if summary.open:
with summary:
with st.spinner("Loading summary..."):
time.sleep(2)
st.write("This is the summary")
12 changes: 12 additions & 0 deletions python/api-examples-source/layout.popover-callback.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import streamlit as st


def on_popover_change():
if st.session_state.drawer:
st.toast("You opened the popover.")
else:
st.toast("You closed the popover.")


with st.popover("Open popover", on_change=on_popover_change, key="drawer"):
st.write("This is the popover")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import streamlit as st

drawer = st.popover("Open popover", on_change="rerun")
with drawer:
st.write("This is the popover")

st.space("large")
st.write(f"The popover is {':green[open]' if drawer.open else ':red[closed]'}.")
9 changes: 9 additions & 0 deletions python/api-examples-source/layout.popover-lazy-load.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import streamlit as st
import time

drawer = st.popover("Open popover", on_change="rerun")
with drawer:
if drawer.open:
with st.spinner("Loading popover..."):
time.sleep(2)
st.write("This is the popover")
22 changes: 22 additions & 0 deletions python/api-examples-source/layout.tabs-callback.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import streamlit as st


def on_tab_change():
st.toast(f"You opened the {st.session_state.animal} tab.")


cat, dog, owl = st.tabs(
["Cat", "Dog", "Owl"], on_change=on_tab_change, key="animal"
)

if cat.open:
with cat:
st.write("This is the cat")

if dog.open:
with dog:
st.write("This is the dog")

if owl.open:
with owl:
st.write("This is the owl")
24 changes: 24 additions & 0 deletions python/api-examples-source/layout.tabs-conditional-outside.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import streamlit as st

cat, dog, owl = st.tabs(["Cat", "Dog", "Owl"], on_change="rerun")

with cat:
st.write("This is the cat")

with dog:
st.write("This is the dog")

with owl:
st.write("This is the owl")

if cat.open:
options = ["orange", "tuxie", "tortie"]
cat_color = st.sidebar.selectbox("What color is your cat?", options)

if dog.open:
options = ["golden", "black", "white"]
dog_color = st.sidebar.selectbox("What color is your dog?", options)

if owl.open:
options = ["brown", "white", "black"]
owl_color = st.sidebar.selectbox("What color is your owl?", options)
22 changes: 22 additions & 0 deletions python/api-examples-source/layout.tabs-lazy-load.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import streamlit as st
import time

cat, dog, owl = st.tabs(["Cat", "Dog", "Owl"], on_change="rerun")

if cat.open:
with cat:
with st.spinner("Loading cat..."):
time.sleep(2)
st.write("This is the cat")

if dog.open:
with dog:
with st.spinner("Loading dog..."):
time.sleep(2)
st.write("This is the dog")

if owl.open:
with owl:
with st.spinner("Loading owl..."):
time.sleep(2)
st.write("This is the owl")
2 changes: 1 addition & 1 deletion python/api-examples-source/mpa-hello/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ numpy==1.23.5
altair==4.2.0
pydeck==0.8.0
opencv-python-headless==4.8.1.78
streamlit>=1.54.0
streamlit>=1.55.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
streamlit>=1.54.0
streamlit>=1.55.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
streamlit>=1.54.0
streamlit>=1.55.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
streamlit>=1.54.0
streamlit>=1.55.0
2 changes: 1 addition & 1 deletion python/api-examples-source/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ pydeck
Faker
openai
vega_datasets
streamlit>=1.54.0
streamlit>=1.55.0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
streamlit>=1.54.0
streamlit>=1.55.0
toml
sqlalchemy==1.4
duckdb
Expand Down
2 changes: 1 addition & 1 deletion python/api-examples-source/theming/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
streamlit>=1.54.0
streamlit>=1.55.0
vega_datasets
altair==4.2.0
plotly==5.13.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
streamlit>=1.54.0
streamlit>=1.55.0
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
vega_datasets
streamlit>=1.54.0
streamlit>=1.55.0
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Faker
streamlit>=1.54.0
streamlit>=1.55.0
2 changes: 1 addition & 1 deletion python/api-examples-source/tutorials/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
streamlit>=1.54.0
streamlit>=1.55.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
streamlit>=1.54.0
streamlit>=1.55.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
streamlit>=1.54.0
streamlit>=1.55.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
streamlit>=1.54.0
streamlit>=1.55.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
streamlit>=1.54.0
streamlit>=1.55.0
2 changes: 1 addition & 1 deletion python/concept-source/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
streamlit>=1.54.0
streamlit>=1.55.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
streamlit>=1.54.0
streamlit>=1.55.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
streamlit>=1.54.0
streamlit>=1.55.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
streamlit>=1.54.0
streamlit>=1.55.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
streamlit>=1.54.0
streamlit>=1.55.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
streamlit>=1.54.0
streamlit>=1.55.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
streamlit>=1.54.0
streamlit>=1.55.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
streamlit>=1.54.0
streamlit>=1.55.0
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
streamlit>=1.54.0
streamlit>=1.55.0
langchain-openai