react-lazy-load-images-demo-package-test
TypeScript icon, indicating that this package has built-in type declarations

0.6.0 • Public • Published

React Lazy Images

React lazy load images with IntersectionObserver.

Usage

import React from 'react';
import Lazy from "react-intersection-images"

const App = () => {
  const placeholder = "https://picsum.photos/id/237/500/300"

  const generateImg = () => `https://picsum.photos/id/${Math.floor(Math.random() * 999)}/500/300`

  return (
    <div>
      <Lazy placeholder={placeholder} force={true} src={generateImg()} ratio={0.1} />
      <Lazy placeholder={placeholder} src={generateImg()} ratio={0.1} />
      <Lazy placeholder={placeholder} src={generateImg()} ratio={0.1} />
      <Lazy placeholder={placeholder} src={generateImg()} ratio={0.1} />
      <Lazy placeholder={placeholder} src={generateImg()} ratio={0.1} />
      <Lazy placeholder={placeholder} src={generateImg()} ratio={0.1} />
    </div>
  );
}

export default App;

/react-lazy-load-images-demo-package-test/

    Package Sidebar

    Install

    npm i react-lazy-load-images-demo-package-test

    Weekly Downloads

    1

    Version

    0.6.0

    License

    none

    Unpacked Size

    25.8 kB

    Total Files

    8

    Last publish

    Collaborators

    • barisesen