Call Topbar_Show to show and Topbar_Hide to hide the progress bar. Before Topbar_Hide is called, the progress bar will move slower and slower but never actually reach 100%. If you navigate from the page, the topbar will hide automatically.
You can also use the AutoTopbar block to have this behavior done automagically! Just provide a query selector like a class or an html tag to attach a listener to those elements that will do the magic for you.
E.g: ".trigger-topbar" will attach the event to all clickable elements with the class "trigger-topbar" and "a" will attach the event to all links.
Be sure to add the AutoTopbar_Hide block to your layout or screen if you want the topbar to disappear after a successful navigation.
Optionally, you can configure your topbar. Use the Topbar_SetConfigs action for that. You can configure:
I advise you to only configure the "BarColors" property for better results, but hack away!
For mobile apps:
If you're having trouble displaying the topbar in native mobile apps, it's because the status bar is on top of it. Try adding the following CSS:
.statusbar-overlay canvas.topbar {
top: var(--status-bar-height) !important;
}
I advice to configure only the "BarColors" property for better results, but hack away!