1.0.9 • Published 5 years ago

react-lazy-imager v1.0.9

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

React-Imager

The imager is used to replace tag, and it will lazy to load the picture.

Installation and usage

Install

npm install -S react-imager

Then use it in your app:

import React from 'react';
import Img from 'react-imager';

class App extends React.Component {

  successCallback(){

  }

  render() {
    return (
      <Img 
        src="./expamle.png" 
        thumbSrc="./thumb.png" 
        className="demo"/>
        onSuccess={this.successCallback}
    );
  }
}

Props

It has all the attributes of the \<img> tag, such as:

  • src
  • style
  • className
  • alt
  • thumbSrc: display before the src is loaded
  • errorSrc: display while load src failed
  • onSuccess: callback after the image is successfully loaded
  • onFailed: callback after the image is failed loaded

License

MIT License

Keywords

react image lazyload img

1.0.9

5 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago