Spaces:
Sleeping
Sleeping
Add responsive examples
Browse files
README.md
CHANGED
@@ -4,7 +4,7 @@ emoji: 🐢
|
|
4 |
colorFrom: red
|
5 |
colorTo: yellow
|
6 |
sdk: streamlit
|
7 |
-
sdk_version: 1.
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: mit
|
|
|
4 |
colorFrom: red
|
5 |
colorTo: yellow
|
6 |
sdk: streamlit
|
7 |
+
sdk_version: 1.18.1
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: mit
|
app.py
CHANGED
@@ -1,24 +1,46 @@
|
|
|
|
1 |
import streamlit as st
|
2 |
-
from streamlit_webrtc import webrtc_streamer
|
3 |
-
import av
|
4 |
|
5 |
|
6 |
-
|
|
|
7 |
|
|
|
|
|
|
|
|
|
8 |
|
9 |
-
|
10 |
-
|
|
|
|
|
11 |
|
12 |
-
|
13 |
|
14 |
-
|
|
|
15 |
|
|
|
|
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from datetime import datetime, time
|
2 |
import streamlit as st
|
|
|
|
|
3 |
|
4 |
|
5 |
+
st.title("Streamlit App at Hugging Face Spaces!")
|
6 |
+
st.image("https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo-with-title.png")
|
7 |
|
8 |
+
with st.form("my_form"):
|
9 |
+
st.write("Inside the form")
|
10 |
+
slider_val = st.slider("Form slider")
|
11 |
+
checkbox_val = st.checkbox("Form checkbox")
|
12 |
|
13 |
+
# Every form must have a submit button.
|
14 |
+
submitted = st.form_submit_button("Submit")
|
15 |
+
if submitted:
|
16 |
+
st.write("slider", slider_val, "checkbox", checkbox_val)
|
17 |
|
18 |
+
col1, col2, col3 = st.columns(3)
|
19 |
|
20 |
+
with col1:
|
21 |
+
st.image("https://static.streamlit.io/examples/cat.jpg")
|
22 |
|
23 |
+
with col2:
|
24 |
+
st.image("https://static.streamlit.io/examples/dog.jpg")
|
25 |
|
26 |
+
with col3:
|
27 |
+
st.image("https://static.streamlit.io/examples/owl.jpg")
|
28 |
+
|
29 |
+
with st.sidebar:
|
30 |
+
st.image("https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.png")
|
31 |
+
|
32 |
+
values = st.slider(
|
33 |
+
'Select a range of values',
|
34 |
+
0.0, 100.0, (25.0, 75.0))
|
35 |
+
st.write('Values:', values)
|
36 |
+
|
37 |
+
appointment = st.slider(
|
38 |
+
"Schedule your appointment:",
|
39 |
+
value=(time(11, 30), time(12, 45)))
|
40 |
+
st.write("You're scheduled for:", appointment)
|
41 |
+
|
42 |
+
start_time = st.slider(
|
43 |
+
"When do you start?",
|
44 |
+
value=datetime(2020, 1, 1, 9, 30),
|
45 |
+
format="MM/DD/YY - hh:mm")
|
46 |
+
st.write("Start time:", start_time)
|