1.0.4 • Published 2 years ago

laziest-react-image v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

React Component to lazy load images. The package uses "lazy" attribute of an img element to optimize loading when an image is in the viewport or close to it. Put a src of the image placeholder and the image itself to make the widget work. The Low-res placeholder can be generated on https://blurha.sh/

Installation

# Yarn
$ yarn add laziest-react-image

# NPM
$ npm i laziest-react-image

Usage

import React from "react";
import { LazyImage } from "react-laziest-image";
import image from "/image.png";
import placeholder from "/placeholder.png";

const ExampleComponent = () => (
    <LazyImage placeholder={placeholder} img={image} alt="alt attribute" />
);
1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago