I am making a multiple page app. On the sidebar, st.sidebar.header(“Company name”) and st.sidebar.image(image) would put the “Company name” and the log below the names of Pages.
I would like to put the company name and logo on the top of sidebar, above the names of Pages. Anyone can help?
-paul
1_Page1.py:
import streamlit as st
from PIL import Image
image = Image.open("logo.png")
st.set_page_config(layout="wide")
st.header("This is Page1")
st.sidebar.header("Company name")
st.sidebar.image(image)
pages/2_Page2.py:
import streamlit as st
st.set_page_config(layout="wide")
st.header("This is Page2")
FYI we’re also working on supporting this natively. But it’s going to take a bit since we are currently focusing on some other projects. streamlit-extras is a good hack in the meantime!
Hi Johannes, it’s good to know you are working on supporting this natively. There are two limitations in add_logo() in streamlit-extras, if possible, please remove the limitations in the native support,
If I want to put some texts(like the company name) above or below the logo, my workaround is to add the text by editing the logo. It would be better to add the texts by Python codes.
Add_logo() uses URL paths, it would be better to use PIL’s image as well.