finds.dev

toddmotto/echo

Lazy-loading images with data-* attributes

View on GitHubHomepage ↗

★ 3,696JavaScriptupdated Feb 2026

// the take

Echo.js is a minimal vanilla JavaScript library for lazy-loading images using data attributes. It predates the native `loading="lazy"` attribute and IntersectionObserver, which now handle this use case in every browser worth supporting. At 2KB it does what it says, but the problem it solves no longer requires a library.

Zero dependencies and a tiny footprint — if you're stuck supporting IE8, this is cleaner than rolling your own scroll listener. The offset API is granular enough to handle asymmetric preloading (different top/bottom/left/right thresholds). Background image lazy-loading via data-echo-background is a nice touch that native loading= doesn't cover. The debounce/throttle distinction is exposed explicitly rather than buried.

The scroll listener approach is the old way — IntersectionObserver is now baseline across all modern browsers and is more accurate, cheaper on the main thread, and handles iframes. Last meaningful update appears to be years old; the repo is effectively unmaintained. No support for srcset or picture elements, so responsive images are left out entirely. The placeholder approach (blank.gif) causes an extra HTTP request and flickers on slow connections compared to a transparent data URI or aspect-ratio CSS.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
3,696
Forks
493
Language
JavaScript
Last commit
13 Feb 2026

// nearby

If echo isn't quite it.

All repos →