Skip to content

Free Tool

Scroll Progress Bar

Add a visual scroll progress indicator to your Squarespace site. Customize color, height, and position, then copy the code into your Code Injection settings.

Why this matters

A scroll progress bar shows a reader’s position in the whole page. It does not measure whether they read the content or help them jump to a specific heading. For a long article, pair it with clear headings and a useful contents list. Use it on long guides, case studies, and documentation pages.

Customize

3px

Use a six-digit hex color, such as #225544.

Background

Advanced

9999

Live Preview

Scroll inside the preview, or focus it and use the arrow keys, to see the progress bar in action. This sample previews appearance and scroll position. Blog-only targeting and stacking order must be checked on your published site.

Generated Code

<style>
  .scroll-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 9999;
    pointer-events: none;
  }
  .scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: #000000;
    transition: width 80ms linear;
  }
</style>

<script>
(function() {
  var container = document.createElement('div');
  container.className = 'scroll-progress-container';
  var bar = document.createElement('div');
  bar.className = 'scroll-progress-bar';
  container.appendChild(bar);
  document.body.appendChild(container);

  function updateProgress() {
    var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
    var docHeight = document.documentElement.scrollHeight - window.innerHeight;
    var progress = docHeight > 0 ? (scrollTop / docHeight) * 100 : 0;
    bar.style.width = Math.min(progress, 100) + '%';
  }

  window.addEventListener('scroll', updateProgress, { passive: true });
  updateProgress();
})();
</script>

How to add this to Squarespace

  1. Go to Website → Pages → Custom Code → Code Injection
  2. Back up your existing footer code. Paste the complete export into the Footer field without replacing other scripts.
  3. Save, exit editing, and inspect a long page and a short page on desktop and mobile.
  4. The code runs on every page. Its percentage includes the full document height, including the header and footer.

This generator and its export are free. Your Squarespace plan must support JavaScript Code Injection. Check the current Squarespace Code Injection requirements before installing. Remove an older copy before adding another; this export does not replace itself automatically. To undo the change, remove only this export and save. Keep your backup.

Help readers find the next useful section.

Position, navigation, and reading time answer different questions. Choose the one your page needs. You can keep using this free progress bar without buying another tool.

Need a hand with your site?

Get help installing, styling, or troubleshooting your changes.