āœØ A cool way to handle image lazy-loading, optimizing, UX with React.js

wellyshen

Welly

Posted on December 11, 2019

āœØ A cool way to handle image lazy-loading, optimizing, UX with React.js

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 and react-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
Enter fullscreen mode Exit fullscreen mode
šŸ’– šŸ’Ŗ šŸ™… šŸš©
wellyshen
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.

Related