āØ A cool way to handle image lazy-loading, optimizing, UX with React.js
Welly
Posted on December 11, 2019
react-cool-img is a lightweight React <Img />
component, which helps you handle image UX (user experience) and performance optimization as a professional guy š¤
It empowers the standard img
tag by many cool features without breaking your original development experience. Ideally, it can be an img
tag replacement for React.js.
ā”ļø Live demo: https://react-cool-img.org
Support features:
- š¼ Placeholders for satisfying various image loading states (e.g. loading image > actual image > error image).
- š Smart lazy loading with performant and efficient way, using Intersection Observer.
- š¤ Built-in auto-retry mechanism. User won't miss out your important information.
- š« Aborts any current image downloads on component unmount potentially saving bandwidth and browser resources.
- š Supports server-side rendering / Javascript is disabled / SEO.
- š Supports TypeScript type definition.
- š¦ Tiny size (~ 2kB gzipped). No external dependencies, aside for the
react
andreact-dom
. - š° Easy to use.
For more usage details checkout the project's GitHub page: https://github.com/wellyshen/react-cool-img.https://github.com/wellyshen/react-cool-starter
You can also install this package is distributed via npm.
$ yarn add react-cool-img
# or
$ npm install --save react-cool-img
š šŖ š
š©
Welly
Posted on December 11, 2019
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.