Socket
Socket
Sign inDemoInstall

react-progressive-image-loading

Package Overview
Dependencies
0
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-progressive-image-loading

Progressively load images using a blur effect. Edit


Version published
Maintainers
1
Install size
18.5 kB
Created

Readme

Source

React Progressive Image Loading

Progressively load images using a blur effect.

CircleCI npm version

example

Installation

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

Usage

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

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

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

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">
{(src, style) => <img src={src} style={style} />}
</ProgressiveImage>

In case of background=true, it is possible to add some layers on top of the background image, for instance:

<ProgressiveImage
  preview="/images/tiny-preview.png" src="/images/preview.png" background={true}
  backgroundImages={["linear-gradient(to top, rgba(31,31,31,0.3), rgba(31,31,31,0.3))"]}
/>

Keywords

FAQs

Last updated on 02 May 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc