mediNER / app.py
georad's picture
Update app.py
645f459 verified
raw
history blame
1.54 kB
import streamlit as st
# --- SHARED ON ALL PAGES ---
#st.logo(image=":material/medical_information:")
st.logo("images/medical_information_24dp_1F1F1F_FILL0_wght400_GRAD0_opsz24.png")
st.sidebar.text("Project by SPG")
# --- PAGE SETUP ---
home_page = st.Page(
page="pages/home.py",
title="Home",
icon=":material/home:",
default=True,)
type_text_page = st.Page(
page="pages/type_text.py",
title="type text",
icon=":material/keyboard:",
default=False,)
upload_file_page = st.Page(
page="pages/upload_file.py",
title="upload file",
icon=":material/file_upload:",
default=False,)
about_page = st.Page(
page="pages/about.py",
title="About the app",
icon=":material/info:",
default=False)
# This is the key trick:
# 1. Define all content first
content = [f"This is scrollable content line {i}" for i in range(100)]
# 2. Display first part of content
for i in range(len(content) - 1):
st.write(content[i])
# 3. Add a placeholder for the last item
last_item = st.empty()
# 4. Show "Bottom Reached!" message to confirm we're at the bottom
st.success("Bottom of page reached!")
# 5. Finally, add the last content item
# This forces Streamlit to render the page up to the bottom
last_item.write(content[-1])
# --- NAVIGATION SETUP ---
#pg = st.navigation(pages=[home_page, type_text_page, upload_file_page, about_page]) # WITHOUT SECTIONS
pg = st.navigation({"Home": [home_page], "Demo": [type_text_page, upload_file_page], "About": [about_page]}) # WITH SECTIONS
pg.run()