Widgets & Mini-Apps

Ultra-thin reading progress rails: Real-time scroll depth tracking with gradient accents

A slender reading progress bar at the very top of the window provides reassuring momentum for readers. In this lab, we build a pure CSS scroll-linked progress line that fills proportionally as the user scrolls.

Top Reading Progress Bar Studio

Three Steps to Embed Reading Progress Indicators

1

Style Gradient Line

Select bar height (2px to 8px) and pick dual gradient stops for a vibrant energy line that glows as readers scroll.

2

Configure Corner Badges

Toggle the floating corner percentage pill and enable the estimated reading time remaining readout.

3

Export Zero-Dependency Code

Copy production CSS and passive vanilla JS scroll listeners ready to embed on articles, blogs, and docs.

Features & CSS Best Practices

✓

Passive Scroll Performance

Passive event listeners ensure butter-smooth 60fps scrolling without blocking user touch interactions.

✓

Reading Time Calculation

Dynamically estimates minutes left based on unread article length to boost content completion rates.

✓

Zero Cumulative Layout Shift

Anchored via position: fixed on top of the viewport with zero layout displacement or content jumping.

✓

Sub-2KB Lightweight Footprint

Skip heavy scroll observation libraries in favor of clean native browser properties and CSS gradients.

Why Reading Progress Bars Increase Content Engagement

Long-form technical articles, case studies, and documentation guides often lose readers when users cannot tell how much content remains. Top scroll progress bars provide instant visual feedback on reading depth, reducing bounce rates and increasing average time on page by up to 22%.

Calculating Scroll Percentage Efficiently

To compute exact page scroll completion without triggering layout thrashing:

function updateProgress() {
  const scrollTop = window.scrollY;
  const docHeight = document.documentElement.scrollHeight - window.innerHeight;
  const progress = docHeight > 0 ? (scrollTop / docHeight) * 100 : 0;
  progressBar.style.width = `${progress}%`;
}

window.addEventListener('scroll', updateProgress, { passive: true });

Modern CSS Linear Gradient Animation

The progress line utilizes a 90-degree linear-gradient with box-shadow glow, producing an electric neon line that highlights progress across dark and light backgrounds alike.

WordPress & Elementor Integration

How to Use This Reading Progress Bar in Elementor

Eliminate bulky progress bar plugins that trigger scroll lag. Embed this GPU-accelerated, zero-dependency reading progress line directly into your Elementor blog templates in 3 simple steps.

1

Copy Elementor / WP Code

In the code studio above, switch to the Elementor / WP tab and click Copy to get the self-contained bundle with scoped styles, progress markup, and passive scroll JS.

2

Insert an HTML Widget

In your WordPress dashboard, open your Elementor Theme Builder Single Post template (or any page). Drag an HTML widget anywhere onto the canvas.

3

Paste & Publish

Paste the snippet into the HTML Code box. The reading bar anchors fixed to the top of the browser viewport with smooth 60fps tracking and reading time estimation.

🎨

Sync with Elementor Global Colors

Easily match your site branding by changing --sp-start in the <style> block to var(--e-global-color-primary) or your theme primary accent color.

⚡

Zero Scroll Stutter (Passive Listeners)

Uses passive scroll event listeners and GPU-composited CSS transforms, ensuring silky-smooth 60fps scrolling without blocking user interaction or battery life.

Frequently Asked Questions

How does the progress bar calculate scroll depth without causing scroll lag?

The widget uses a passive scroll event listener: percentage = (window.scrollY / (document.scrollHeight - window.innerHeight)) * 100. It updates a hardware-accelerated width or transform scaleX property on the compositor thread.

How is the estimated reading time remaining computed?

Based on standard adult reading speeds of 200–250 words per minute, the widget calculates remaining words based on the unread scroll percentage and dynamically updates the 'X min left' badge.

Can this progress bar stick to the top of articles without covering headers?

Yes. With a position: fixed top: 0 declaration and z-index: 999999, it remains anchored to the top of the browser viewport seamlessly across all devices.

How do I add a reading progress bar in Elementor without plugins?

Switch to the Elementor / WP tab in the code studio above and click Copy. In WordPress, open your Elementor Single Post template or target page, drag an HTML widget into your layout, and paste the code snippet. The progress bar floats fixed at the top of the viewport with hardware-accelerated scroll tracking, gradient styling, and reading time calculation with zero external plugins.