georad commited on
Commit
7d62d73
·
verified ·
1 Parent(s): b8d3aac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -27
app.py CHANGED
@@ -2,33 +2,27 @@ import streamlit as st
2
  #from streamlit_navigation_bar import st_navbar
3
 
4
 
5
- def page1():
6
- st.write("This is the home page")
7
-
8
-
9
- pages = [
10
- st.Page(page = "pages/type_text.py", icon=":material/home:", title="Home"),
11
- #st.Page(page2, icon=":material/filter:", title="Filter"),
12
- #st.Page(page3, icon=":material/settings:", title="Settings"),
13
- #st.Page(page4, icon=":material/map:", title="Map"),
14
- ]
15
- current_page = st.navigation(pages=pages, position="hidden")
16
-
17
- st.set_page_config(layout="wide")
18
-
19
- num_cols = max(len(pages) + 1, 8)
20
-
21
- columns = st.columns(num_cols, vertical_alignment="bottom")
22
-
23
- columns[0].write("**My App Name**")
24
-
25
- for col, page in zip(columns[1:], pages):
26
- col.page_link(page, icon=page.icon)
27
-
28
- st.title(f"{current_page.icon} {current_page.title}")
29
-
30
- current_page.run()
31
-
32
 
33
 
34
 
 
2
  #from streamlit_navigation_bar import st_navbar
3
 
4
 
5
+ header = st.container()
6
+ header.title("Here is a sticky header")
7
+ header.write("""<div class='fixed-header'/>""", unsafe_allow_html=True)
8
+
9
+ ### Custom CSS for the sticky header
10
+ st.markdown(
11
+ """
12
+ <style>
13
+ div[data-testid="stVerticalBlock"] div:has(div.fixed-header) {
14
+ position: sticky;
15
+ top: 2.875rem;
16
+ background-color: white;
17
+ z-index: 999;
18
+ }
19
+ .fixed-header {
20
+ border-bottom: 1px solid black;
21
+ }
22
+ </style>
23
+ """,
24
+ unsafe_allow_html=True
25
+ )
 
 
 
 
 
 
26
 
27
 
28