StealThis .dev

Scroll Progress Indicator

Expose document progress with scroll() and a JS fallback for long-form content.

Open in Lab
html css javascript react
Targets: TS JS HTML React

Code

Scroll Progress Indicator

Expose document progress with scroll() and a JS fallback for long-form content.

Support notes

The CSS uses animation-timeline where available and a small JavaScript fallback where it is not. Keep the fallback because scroll-linked CSS support varies by browser.

Included demo

  • Vanilla HTML, CSS, and JavaScript with zero external dependencies.
  • React equivalent using the same interaction model.
  • A Lab route for trying the behavior in isolation.

Integration checklist

Keep state updates separate from presentation, preserve semantic labels, and add persistence or server callbacks at the boundary where your product needs them.