0.0.10 • Published 3 years ago

@odnh/react-lazy-image v0.0.10

Weekly downloads
-
License
-
Repository
github
Last release
3 years ago

React Lazy Image

live demo

Install

  // npm
  npm install @odnh/react-lazy-image

  // yarn
  yarn add @odnh/react-lazy-image

Use

import LazyImage from "@odnh/react-lazy-image";

function App() {
  const imageUrl = "...";

  return (
    <section class="app">
      <LazyImage src={imageUrl} distance="50px 0" title="image" alt="alt" />
    </section>
  );
}

props

nametypedescriptiondefault value
distancestring (css margin)Adjusting the distance to enter the viewport more'10%'
thresholdnumber or number[]The criteria by which the image appears (ratio) more0.0
{{ img tag attributes }}ImgHTMLAttributesattributes of img tag-
0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago