SeonHyungJo / react-lazy-loading-image

🖼️react-lazy-loading-image

Home Page:https://seonhyungjo.github.io/react-lazy-loading-image/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Lazy Img Logo

React Lazy Image Component

NPM JavaScript Style Guide

Install

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

Usage

import * as React from 'react'

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

class Example extends React.Component {
  render () {
    return (
      // Main Page init image
      <img src={address}/>
      // Use LazyImg Components for lazy loading img
      <LazyImg src={"https://seonhyungjo.github.io/react-lazy-loading-image/"}/>
    )
  }
}

API

LazyImg

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

This is not General Image Component

Prop Type Required Description
src string The image source
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 © 🐭snyung

About

🖼️react-lazy-loading-image

https://seonhyungjo.github.io/react-lazy-loading-image/

License:MIT License


Languages

Language:TypeScript 40.7%Language:JavaScript 36.7%Language:HTML 16.3%Language:CSS 6.3%