react-lazy-loading-image

<p align="center"> <a href="https://seonhyungjo.github.io/react-lazy-loading-image/"><img width="140" src="./static/lazy-logo.png" alt="React Lazy Img Logo" /></a>

Usage no npm install needed!

<script type="module">
  import reactLazyLoadingImage from 'https://cdn.skypack.dev/react-lazy-loading-image';
</script>

README

React Lazy Img Logo

React Lazy Img

NPM JavaScript Style Guide

Install

npm install --save react-lazy-loading-image

Usage

import * as React from 'react'

import MyComponent from 'react-lazy-loading-image'

class Example extends React.Component {
  render () {
    return (
      <MyComponent src={}/>
    )
  }
}

API

LazyImg

Image component working similar with standard img tag and with the following props.

Prop Type Required Description
src string The image source
lazy boolean Set lazy image
id string Element Id
className string Element Class Name
alt string Image alt
sizes any Image default sizes
srcset string Image srcset
style object Element Inline Style
height number Image Default height
width number Image Default width
border string Image Default border

License

MIT © :mouse:snyung