Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,42 @@
|
|
1 |
import streamlit as st
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
# --- SHARED ON ALL PAGES ---
|
5 |
st.logo(image="images/menu_book_60dp_75FBFD.png")
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
+
# Set page config
|
4 |
+
st.set_page_config(page_title="Fixed Status Widget", layout="wide")
|
5 |
+
|
6 |
+
# CSS to specifically target the status widget and make it sticky
|
7 |
+
st.markdown("""
|
8 |
+
<style>
|
9 |
+
/* Target the status widget container */
|
10 |
+
[data-testid="stStatusWidget"] {
|
11 |
+
position: sticky !important;
|
12 |
+
top: 0px;
|
13 |
+
z-index: 1000000;
|
14 |
+
width: auto;
|
15 |
+
right: 0px;
|
16 |
+
background-color: white;
|
17 |
+
padding: 4px;
|
18 |
+
border-bottom-left-radius: 4px;
|
19 |
+
box-shadow: 0 0 4px rgba(0,0,0,0.1);
|
20 |
+
}
|
21 |
+
|
22 |
+
/* Add padding to the top of the main content */
|
23 |
+
.main .block-container {
|
24 |
+
padding-top: 2rem;
|
25 |
+
}
|
26 |
+
</style>
|
27 |
+
""", unsafe_allow_html=True)
|
28 |
+
|
29 |
+
# Your regular Streamlit app content
|
30 |
+
st.title("App with Fixed Status Widget")
|
31 |
+
|
32 |
+
# Add sample content to demonstrate scrolling
|
33 |
+
st.write("Scroll down to see the status widget remain fixed at the top")
|
34 |
+
|
35 |
+
# Generate content to enable scrolling
|
36 |
+
for i in range(30):
|
37 |
+
st.write(f"Content line {i}")
|
38 |
+
if i % 5 == 0:
|
39 |
+
st.markdown("---")
|
40 |
|
41 |
# --- SHARED ON ALL PAGES ---
|
42 |
st.logo(image="images/menu_book_60dp_75FBFD.png")
|