lazy-load-kle

1.0.3 • Public • Published

lazy-load-kle

lazy load img with intersectionObserver

NPM JavaScript Style Guide

Install

npm install --save lazy-load-kle

Usage

live demo

Live demo
import React, { Component } from 'react'

import{ LazyLoad , LazyEarly } from 'lazy-load-kle'

class Example extends Component {
  render() {
    return <LazyLoad src='link of img' alt='alt' placeholder='link placeholder image' className='add some class for img'/>
    <!-- Load when image in screen -->
    <LazyEarly src='link of img' alt='alt' placeholder='link placeholder image' className='add some class for img' early={value(2300)}/>
    <!-- Load when image margin = early (default = 200px) -->
  }
}

License

MIT © phamqi

Dependencies (0)

    Dev Dependencies (19)

    Package Sidebar

    Install

    npm i lazy-load-kle

    Weekly Downloads

    0

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    257 kB

    Total Files

    7

    Last publish

    Collaborators

    • phamqi