#2 · Primary category: Web Performance & Predictive Loading
vanilla-lazyload
A lightweight vanilla JavaScript lazy loading library that defers images, videos, iframes, and scripts until they enter the viewport, using IntersectionObserver and supporting responsive images.
Project last updated:06/22/26
GitHub Stars
7.9K
Forks
673
Contributors
47
License
MIT
Why we included this project
Pages heavy on images, embedded video, or third-party iframes slow down noticeably on first load, and vanilla-lazyload is a battle-tested way to fix that without pulling in a framework. It's a tiny script, around 2.4 kB, that defers anything below the fold until it actually scrolls into view, using the IntersectionObserver API. The real value is in the details it handles for you: responsive images through srcset and sizes, the picture tag with WebP fallbacks, background images with HiDPI variants, animated SVGs, and video posters. You swap real attributes for data- attributes in your markup and instantiate it with a few lines of JavaScript. It also keeps a fallback for browsers without IntersectionObserver, which makes it a safe pick for sites that still serve older browsers.
Articles for this project
No articles for this project yet.
To suggest a topic or contribute an article, contact us.
Related projects in this category
lazysizes
High performance and SEO friendly lazy loader for images (responsive and normal), iframes and more, that detects any visibility changes triggered through user interaction, CSS or JavaScript without configuration.
guess
🔮 Libraries & tools for enabling Machine Learning driven user-experiences on the web