|
import streamlit as st |
|
|
|
|
|
st.set_page_config(page_title="My App", layout="wide") |
|
|
|
|
|
st.title("My App Title") |
|
|
|
|
|
header = st.container() |
|
with header: |
|
col1, col2 = st.columns([3, 1]) |
|
with col1: |
|
st.subheader("Custom Sticky Navigation") |
|
with col2: |
|
st.button("Button 1") |
|
|
|
|
|
st.markdown(""" |
|
<style> |
|
/* Target only our specific header container */ |
|
[data-testid="stContainer"]:first-child { |
|
position: -webkit-sticky; |
|
position: sticky; |
|
top: 0px; |
|
background-color: #f0f5f5; |
|
padding: 1rem; |
|
z-index: 50; |
|
border-bottom: 1px solid #ddd; |
|
} |
|
|
|
/* Ensure this doesn't affect other containers */ |
|
[data-testid="stContainer"]:not(:first-child) { |
|
margin-top: 1rem; |
|
} |
|
</style> |
|
""", unsafe_allow_html=True) |
|
|
|
|
|
st.write("Main content starts here") |
|
|
|
|
|
for i in range(30): |
|
st.write(f"Content line {i}") |
|
|
|
|
|
|
|
|
|
|
|
st.logo(image="images/menu_book_60dp_75FBFD.png") |
|
st.sidebar.title("SBS V2.0 mapper") |
|
st.sidebar.subheader("(work in progress)") |
|
st.sidebar.text("Demo by JA-RAD") |
|
|
|
|
|
type_text_page = st.Page( |
|
page="pages/type_text.py", |
|
title="DEMO (work in progress)", |
|
icon=":material/keyboard:", |
|
default=True,) |
|
|
|
|
|
pg = st.navigation(pages=[type_text_page]) |
|
|
|
pg.run() |