React Progressive Image Loading

Progressively load images using a blur effect.

React-Progressive-Image-Loading

Installation

$ npm install react-progressive-image-loading --save
Bash

Import

import ProgressiveImage from "react-progressive-image-loading";
React JSX

Usage

<ProgressiveImage
    preview="/images/tiny-preview.png"
    src="/images/preview.png"
    render={(src, style) => <img src={src} style={style} />}
/>
React JSX

Instead of using the img tag, you can use background-image with a div.

<ProgressiveImage
    preview="/images/tiny-preview.png"
    src="/images/preview.png"
    render={(src, style) => <div style={Object.assign(style, { backgroundImage: `url(${src})` })} />}
/>
React JSX

You can also customize the transition time and the timing function used for that transition.

<ProgressiveImage
    preview="/images/tiny-preview.png"
    src="/images/preview.png"
    transitionTime={500}
    transitionFunction="ease"
    render={(src, style) => <img src={src} style={style} />}
/>
React JSX

GitHub

Progressively load images using a blur effect.Read More

Latest commit to the master branch on 8-11-2021
Download as zip