v2.0.3 is out

Lazy load anything
with precision.

A high-performance, lightweight JavaScript utility built on top of the IntersectionObserver API to lazily load anything like, Images, Videos, Components, also Execute Functions.

npm install @bitlaab/lazyload
Get Started

This is a vanilla JavaScript utility. It can be used in React / Next.js and other frameworks as well, also have TypeScript support. Follow the documentation for more details.

Ultra Lightweight

Less than 2KB gzipped. Zero dependencies. Built for performance first.

Intersection Observer

Uses modern browser APIs for efficient element detection and loading.

Universal Support

Lazy load images, background images, iframes, videos, custom components and execute functions.

SEO Friendly

Maintains accessibility and SEO while improving page load speeds.

Highly Configurable

Customize thresholds, root margins, and loading states to fit your needs.

Smooth Transitions

Built-in support for fade-in animations and placeholder management.

Example.js
1<div id="item-wrapper">
2 <img class="lazy-item" data-lazy-url="/image.jpg"/>
3 <video class="lazy-item" data-lazy-url="/video.mp4"></video>
4</div>
5
6---------------------------------------------------------------------
7
8<script type="module">
9 import { Lazyload } from "@bitlaab/lazyload";
10
11 const lazyload = new Lazyload();
12 lazyload.media({
13 wrapper: document.querySelector("#item-wrapper"),
14 srcTarget: ".lazy-item",
15 });
16</script>
17
6.97kb
Unpacked Size
0
Dependencies
99.9%
Browser Support
50k+
Downloads

Ready to optimize your app?

Improve your Core Web Vitals and user experience with just a few lines of code.

Empowering the Community

Bitlaab's Open Source

Here are some open-source things — Powered by Bitlaab — built with the aim of simplifying technology, enhancing the developer experience, encouraging collaboration, and giving back to the developer community.

Everything we build is from our passion for clean code, well-crafted engineering, and a culture of open contribution.

Whether you’re here to learn, use, or contribute — dive in and discover how open source at Bitlaab is helping shape a better tech ecosystem for our fellow programmers and developers.

Thank you for taking the time to explore our open-source projects. Your interest, support, and contributions mean a lot to us and help drive our mission of building better, more open technology for the developer community.