I am posting something that I’ve already seen it posted before but I still don’t have a clear idea of what the current answer to this question really is. I am new to Streamlit, it is quite amazing how quickly you can put together a web app with it, however, in terms of looks, there are clear limitations. One in particular I found is trying to make the sidebar look better when using a multipage app, at least as good as the st.sidebar() component. Is there a way to do this with the latest version of Streamlit, or the only way to work with multipage is to simply accept that the sidebar cannot hold any company logo, a simple form or titles for that matter, but rather just the links to the pages? Any chance this can look closer to the look and feel of the st.sidebar() componet, which is considerably better? Please let me know. Thank you.
Before clicking “Create Topic”, please make sure your post includes the following information (otherwise, the post will be locked).
Are you running your app locally or is it deployed?
If your app is deployed:
a. Is it deployed on Community Cloud or another hosting platform?
b. Share the link to the public deployed app.
Share the link to your app’s public GitHub repository (including a requirements file).
Share the full text of the error message (not a screenshot).
I don’t understand what sidebar you are talking about. As far as I know there is only one sidebar and it can hold titles and images in addition to the navigation menu.
As I understand it, the default sidebar that results from using st.multipage() does not have the same level of customization as the sidebar you get from executing st.sidebar(). Why? that’s my question… if you want to add anything to the sidebar, it goes below the links to the pages generated from keeping your page .py files in te ‘pages’ folder. Thus, if you want to add a logo image, it will go below the links for the pages in the pages folder… this is not an ideal look… hence, I have decided to just create .py files with a single main function and call this function in my main.py files as a substitute to the multipage() functionality and keep the st.sidebar() component, which allows more customization… but again, if I am missing something, please let me know… I am new to Streamlit.
Thanks, I did search around for answers before posting… however, I am still not sure about how much I can do in terms of customization with the default sidebar that’s created when st.multipage() is executed…
As @Goyo had pointed out, the sidebar can hold elements like title, header, subheader, any of the input widgets (sliders, selectbox, etc.), images, etc. In a multipage app, the navigation buttons are automatically generated from the pages/ folder and presented in the sidebar.
Do you have a sketch or mockup design that you have in mind for your sidebar that you’d like to achieve and based on that, the community could provide additional ideas.
One option is to use external lib streamlit-extras.
"""Page with logo in the sidebar.
Logo dependency:
pip install streamlit-extras
"""
import streamlit as st
from streamlit_extras.app_logo import add_logo
# image has 200x200 pixels size
add_logo("./assets/images/logo.png", height=200)
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.