# react-webp-image

> A simple react component for rendering webp images with a fallback for older browsers

Latest version **1.0.8** (published 2020-04-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-webp-image
pnpm add react-webp-image
yarn add react-webp-image
bun add react-webp-image
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2020-04-09 |
| First published | 2018-11-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 21.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Tyler Wolff |
| Maintainers | tylerwolff |
| Keywords | react-component, react, webp, picture, component, image |

## Links

- npm: https://www.npmjs.com/package/react-webp-image
- Repository: https://github.com/tylerwolff/react-webp-image
- Homepage: https://github.com/tylerwolff/react-webp-image#readme
- Issues: https://github.com/tylerwolff/react-webp-image/issues
- npm.io page: https://npm.io/package/react-webp-image

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.8 (latest) — 2020-04-09
- 1.0.7 — 2020-01-19
- 1.0.6 — 2020-01-08
- 1.0.5 — 2019-08-30
- 1.0.4 — 2018-12-01
- 1.0.3 — 2018-11-29
- 1.0.2 — 2018-11-26
- 1.0.1 — 2018-11-25
- 1.0.0 — 2018-11-25

## README

# React webp image

[![npm package][npm-badge]][npm]
![](https://img.shields.io/bundlephobia/minzip/react-webp-image?label=gzip%20size)
[![Travis][build-badge]][build]
[![Coveralls][coveralls-badge]][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

```jsx
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](https://developers.google.com/speed/webp/)

[build-badge]: https://img.shields.io/travis/tylerwolff/react-webp-image/master.svg
[build]: https://travis-ci.org/tylerwolff/react-webp-image
[npm-badge]: https://img.shields.io/npm/v/react-webp-image.svg
[npm]: https://www.npmjs.org/package/react-webp-image
[coveralls-badge]: https://img.shields.io/coveralls/tylerwolff/react-webp-image/master.svg
[coveralls]: https://coveralls.io/github/tylerwolff/react-webp-image

---
_Source: https://npm.io/package/react-webp-image · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
