knc-react-image
v0.0.3-BETA03
Published
A react library to lazy-load images
Downloads
4
Readme
knc-react-image
A simple react-library to lazy-load images
Usage
Add to your package like this:
npm install --save knc-react-image
Or using Yarn:
yarn add knc-react-image
Then in your component
import Image from 'knc-react-image';
const MyComp = () => {
const imgSrc=`https://picsum.photos/200/300`
return <Image src={imgSrc} />
}
Optional parameters
You can add the below optional params:
style
- the styles that you want on the resultant image (img
) tagwidth
- the width of the resultant imageheight
- the height of the resultant image
Peer dependency
Only, one: react
License
MIT.
About me
Here I am: https://knc.js.org
Twitter: @itsKNC