Progress Bar Navbar Template
Very useful navbar that shows a progress bar as the user scrolls down the page (but without being gimmicky). Fully mobile-responsive and accessible.
This is a highly functional and user-centric component, perfect for blogs, documentation sites, and long articles. It provides clear, visual feedback to the user about their progress through the content.

The Progress Bar Navbar
A smart and user-friendly navbar that includes a thin progress indicator. As the user scrolls down a page, the bar fills up, giving them a visual cue of how much content they have read and how much remains. This is particularly useful for long articles, blog posts, and documentation pages.
- Real-time Progress Calculation — JavaScript listens to the scroll event and calculates the user's position as a percentage of the total page height. This percentage is then used to set the width of the progress indicator.
- Unobtrusive Design — The progress bar is a thin, clean line at the very bottom of the navbar, providing useful information without being distracting or taking up extra screen space.
- Performant & Efficient: The component is built with modern and efficient code. The core logic is simple and has minimal impact on performance.
- Accessible by Design: The progress bar is a purely visual element and is hidden from screen readers using
aria-hidden="true"
to avoid unnecessary noise for assistive technology users. All interactive elements are fully accessible. - Standard Layout: Built upon a classic, responsive navbar layout that collapses into a hamburger menu on mobile.
Coding Best Practices
- CSS custom properties (variables) are used for easy theme customization (colors, fonts).
- The code is appropriately commented to explain the purpose of each section.
- A tiny, efficient JavaScript snippet is used for the mobile menu toggle, as it is the most accessible and modern method (arguably superior to the older "checkbox hack").
Code
Here's the full code for the navbar template: