Skip to content

ChaituKNag/npm-lib_knc-react-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-image-lazy-prefetch

A simple react-library to lazy-load or prefetch images

Usage

Add to your package like this:

    npm install --save react-image-lazy-prefetch

Or using Yarn:

    yarn add react-image-lazy-prefetch

Then in your component

import Image from 'react-image-lazy-prefetch';

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) tag
  • width - the width of the resultant image
  • height - the height of the resultant image

Peer dependency

Only, one: react (latest if possible).

License

MIT.

About me

Here I am: https://knc.js.org

Twitter: @itsKNC

Releases

No releases published

Packages

No packages published