#1 · Primary category: Web Performance & Predictive Loading

lazysizes

javascript lazy-evaluation lazyload lazysizes performance responsive-images

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.

Project last updated:04/03/24

GitHub Stars

17.7K

Forks

1.7K

Contributors

57

License

MIT

Why we included this project

lazysizes defers images, iframes, and third-party widgets until they actually come into view, so a content-heavy page stops paying the cost of loading everything on first paint. You mark elements with a lazyload class and data-src attributes, and the script takes it from there: it self-initializes and watches for visibility changes triggered by scrolling, CSS animations, carousels, infinite scroll, or SPA navigation, with no configuration needed. It also does real work on responsive images, computing the sizes attribute automatically and letting you share media queries with your CSS, which makes picture and srcset integration across browsers much simpler. The resource prioritization is a nice touch: near-view assets are prefetched only while the network is idle, and non-scrolling user agents still get the full content, so search engines index what they should. For teams running content-heavy sites or web apps that want faster perceived load times without rewriting their markup, this is a practical, mature option.

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