0.1.2 • Published 4 years ago

react-lazy-image-loader v0.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

react-lazy-image-loader

Simple lazy loader for React.js

  • TypeScript ready

size npm.io

NPM | Github | Feature request

Installation

  • npm install --react-lazy-image-loader
  • yarn add react-lazy-image-loader

How To Use

First import this component where you want to use it

import LazyImage from react-lazy-image-loader"

Then just renders it

<LazyImage src="./link/to/source.jpg" alt="avatar" height={30} width={30} borderRadius={4} />

Props

ProptypeDefault value
srcstringnone
altstringnone
heightnumber?none
widthnumber?none
borderRadiusnumber?2

Example

import React from "react";
import LazyImage from 'react-lazy-image-loader';


const App = () => {
    return (
        <LazyImage src="./link/to/source.jpg" alt="avatar" height={30} width={30} borderRadius={4} />
    );
}

export { App };