# lazy-image-reactjs

> React lazy load image

Latest version **1.3.0** (published 2021-09-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install lazy-image-reactjs
pnpm add lazy-image-reactjs
yarn add lazy-image-reactjs
bun add lazy-image-reactjs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2021-09-01 |
| First published | 2020-04-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | David Matevosyan |
| Maintainers | davmatevosyan |
| Keywords | react-lazy-image, lazy-image |

## Links

- npm: https://www.npmjs.com/package/lazy-image-reactjs
- Repository: https://github.com/MatevosyanDavid/lazy-image-reactjs
- Homepage: https://github.com/MatevosyanDavid/lazy-image-reactjs#readme
- Issues: https://github.com/MatevosyanDavid/lazy-image-reactjs/issues
- npm.io page: https://npm.io/package/lazy-image-reactjs

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2021-09-01
- 1.2.0 — 2020-05-02
- 1.1.1 — 2020-04-18
- 1.1.0 — 2020-04-18
- 1.0.0 — 2020-04-18
- 0.1.0 — 2020-04-18

## README

<a href="https://www.npmjs.com/package/lazy-image-reactjs">
  <img src="https://img.shields.io/badge/npm-lazy--image--reactjs-brightgreen.svg">
</a>
<a href="https://www.npmjs.com/package/lazy-image-reactjs">
  <img src="https://img.shields.io/npm/v/lazy-image-reactjs.svg">
</a>

# React Image Lazy Load
- Based on [window.IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)
## Description
This package created for the lazy loading images
- Lazy-loading of images or other content as a page is scrolled.
- Implementing "infinite scrolling" web sites, where more and more content is loaded and rendered as you scroll, so that the user doesn't have to flip through pages.
- Deciding whether or not to perform tasks or animation processes based on whether or not the user will see the result.
- `dataSrc` attribute allows you to display a placeholder image before displaying a real image

```js
import LazyImage from 'lazy-image-reactjs';

// By default used this options for IntersectionObserver
const options = {
  threshold: 0.01,
  rootMargin: '75%',
}

function App() {
  return (
    <div>
      <LazyImage
        alt="alt"
        src="image.jpg"
        dataSrc="alt.img"
        options={options}
      />
    </div>
  );
}
```

You can play with it in [sandbox](https://codesandbox.io/s/fragrant-paper-2bwoy?file=/src/App.js)

---
_Source: https://npm.io/package/lazy-image-reactjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
