Hello!
My question is related to the new functionality - multi-page applications. This is really what I was missing in the standard library. Previously, I had to use different methods to achieve this, but now it’s really easier. Thanks!
The question is how to hide the page or pages if the preconditions are not met? For example, authorization: this would be useful if the conditional report was intended for different user roles with sensitive data.
I also have a suggestion for page names in navigation. Since on every created page we can use .set_page_config method, i think it’s possible to add an additional page_name parameter for this. It looks clearer and easier.
st.set_page_config(
page_name=":robot_face: My Page Name",
)
One hacky solution to manipulating what pages are shown in the sidebar is to use the get_pages function, which returns a dictionary with strings as keys, and dictionaries containing details about that page. Once this initial page list is generated, it is cached, and you can manipulate it in order to change the list of pages shown in the sidebar. If you create a function which deletes any entries that you would not like to be shown, this will also remove them from the sidebar.
We are working on some changes that should make this easier in the future.
thanks for your feedback, this is super helpful! We’ll be looking at ways how we can improve this first iteration of multipage apps over the next few months. Would love to get a bit more input from you on that. Would you be down to do a 20-30 min call over the next few weeks to tell me a bit more about how you use multipage apps?
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.