Checklist
Summary
I want to add a link to an external web page at the top of the sidebar navigation created by st.navigation. I tried using a st.page_link but it ends up below the navigation menu.
Why?
I need this to redirect my users to the homepage of the project (which isn't a Streamlit app)
How?
This can be solved in different ways :
- allow the
st.Page widget to target external pages
- create a
st.ExternalPage widget which can be fed into the st.navigation widget.
- allow the user to add custom content inside the sidebar navigation created by
st.navigation
Additional Context
Minimal working example :
# -*- coding: utf-8 -*-
import streamlit as st
def main():
st.sidebar.page_link(
page="https://mywebsite.com/home/",
label="**Home**",
icon="🏠",
)
def page1():
st.write("This is page 1")
def page2():
st.write("This is page 2")
pages = {
"Section 1": [
st.Page(page1, title="Page 1", icon="🔐"),
],
"Section 2": [
st.Page(page2, title="Page 2", icon="📚"),
],
}
pg = st.navigation(pages)
pg.run()
if __name__ == "__main__":
main()
Which looks like:

Ideally the 🏠 Home button would be above the navigation menu.
Checklist
Summary
I want to add a link to an external web page at the top of the sidebar navigation created by
st.navigation. I tried using ast.page_linkbut it ends up below the navigation menu.Why?
I need this to redirect my users to the homepage of the project (which isn't a Streamlit app)
How?
This can be solved in different ways :
st.Pagewidget to target external pagesst.ExternalPagewidget which can be fed into thest.navigationwidget.st.navigationAdditional Context
Minimal working example :
Which looks like:
Ideally the
🏠 Homebutton would be above the navigation menu.