1.0.8 • Published 5 years ago

react-webp-image v1.0.8

Weekly downloads
249
License
MIT
Repository
github
Last release
5 years ago

React webp image

npm package npm.io Travis Coveralls

A simple react component for rendering webp images with an image fallback for older browsers. It uses the <picture> tag to support older browsers without the need for feature detection or a polyfill.

Installation

npm install react-webp-image

or

yarn add react-webp-image

Usage

import Img from "react-webp-image";
import imgPath from "assets/photo.png";
import webpPath from "assets/photo.webp";

<Img src={imgPath} webp={webpPath} alt="I'm a webp image" />;

Any additional props will be passed down to the img tag.

Why use webp?

WebP is a modern image format that provides superior lossless and lossy compression for images on the web. WebP lossless images are 26% smaller in size compared to PNGs. WebP lossy images are 25-34% smaller than comparable JPEG images at equivalent SSIM quality index.

Learn more about webp

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago