I am looking to use Streamlit multi-page app feature to prototype a web portal. Think of it as exposing a multi-sheet Excel model onto the web. The MultiPage function has lots of potential. I really like the page load mechanism. I’ve hacked something similar using NavBar menu link and QueryParam for pageID. But the pages reload and flash on each transition. However the multi-page function is missing some features I need. It’s getting close with some solutions provided by @blackary (thanks much). But don’t think I can use it yet. I also like to new st.tabs as menus.
Navigating to a page by hyperlink (like menu items). Same solution as above, may be with style override to make a button look like a link. Not sure if this will work.
An option to not show the sidebar by default. When I try to control it by CSS, it still flashes.
The workaround to control the page list on the sidebar is helpful. link
A menu bar at top similar to a web portal which I can specify which page to load when a menu item is clicked… (looking similar to this)
Sorry for so many questions. I’ve been researching for the last week as to what the best approach would be. I am looking at my NavBar+QueryParam hack, Hydralit framework, and multipage function. I would like to go with MultiPage if I can. Trying to decide quickly since I need to start implementing the actual content pages. Each of these options requires a slightly different framework to start.
I think the best option for a top navbar involves something like the suggestion, with html and css inserted via st.markdown. However, I believe that by default any links clicked will open in a new tab, and I’m not sure if there’s a workaround to avoid that. You might be able to accomplish the same thing by styling some buttons from your bullet #2.
to hide the sidebar. However when the “pages” folder exists, the sidebar automatically shows, then collapses. When the “pages” folder is not there, then I get the behavior I was hoping for. Is there any way around this?
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.