Is there a way to insert image at sidebar? Maybe below the sidebar title?
You can use st.sidebar.image
:
st.sidebar.image("/home/rzwitch/Downloads/randy-streamlit.png", use_column_width=True)
@randyzwitch thx mate, gonna try this maybe today. If something goes wrong i come back here.
Hiya, This doesnât seem to work for some reason! Can you please help?
@vigneshjayanth00 could you please pass a snipp of you code?
Hi Felipe,
I used the same code shared above.
st.sidebar.image(râC:\Users\Home\Pictures\sample.pngâ, use_column_width=True)
My OS is windows! The image doesnât show as shown above
@vigneshjayanth00
maybe there are a problem in the directory you are passing. Check where you image is!
@vigneshjayanth00 I used
from PIL import Image
with st.sidebar.container():
image = Image.open(âpath of imageâ)
st.image(image, width= use_column_width=True)
I am having a similar problem. Your solution works great, but puts the image below the list of pages. Is there any way to add it on top of the sidebar?
streamlit-extras
has a component for that: âApp logoâ
Wow, thanks a lot for this hint!
thank you it helped me to find a solution.