I really like the new multipage functionality in streamlit… but I cannot avoid being repulsed by the method used to add a icon to each app/section.
Adding and emoji to the file name simply to be able to add an icon to the page seems at best a ugly hack.
Surely there must be a more elegant way to do this, for example
Why not make a requirement for every page in a multipage app (the python files within the pages folder) to have a st.set_page_config element
If this is technicaly difficult because you would need to read in each app first before drawing the UI then it would be better to make the definition of the multipage app on the main app itself
for example create a multipage app element that can take in 1 or more args where each arg is a multipage_config element
each multipage_config element contains all the metadata you need to include
and the multiapp element is responsible for drawing the UI as well as maybe even allow the return data for that element be a link we can add in the main page content:
The Streamlit team is considering different ways to improve this behavior, and make it easier to customize the appearance of the multipage sidebar without the need to change the filenames. In the meantime, you might try out GitHub - blackary/st_pages: An experimental version of Streamlit Multi-Page Apps, which I created for exactly this purpose.
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.