lazy-load-kle
v1.0.3
Published
lazy load img with intersectionObserver
Downloads
2
Readme
lazy-load-kle
lazy load img with intersectionObserver
Install
npm install --save lazy-load-kle
Usage
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