# react-auto-height-image

> Load image auto height

Latest version **1.0.1** (published 2022-10-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-auto-height-image
pnpm add react-auto-height-image
yarn add react-auto-height-image
bun add react-auto-height-image
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2022-10-19 |
| First published | 2022-10-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 131 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | letieu |
| Keywords | react, image, loading |

## Links

- npm: https://www.npmjs.com/package/react-auto-height-image
- Repository: https://github.com/letieu/react-auto-height-image
- Homepage: https://github.com/letieu/react-auto-height-image#readme
- Issues: https://github.com/letieu/react-auto-height-image/issues
- npm.io page: https://npm.io/package/react-auto-height-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.1 (latest) — 2022-10-19
- 1.0.0 — 2022-10-19

## README

# react-auto-height-image
Avoid zero height when loading image

[![demo](https://github.com/letieu/react-auto-height-image/blob/master/ezgif.com-gif-maker.gif "demo")](https://github.com/letieu/react-auto-height-image/blob/master/ezgif.com-gif-maker.gif "demo")

**Example**: use my package on the **left** side

## Install
```bash
yarn add react-auto-height-image
#or
npm install react-auto-height-image
```

## Use

Use with your loading component
```jsx
<AutoHeightImage
  src="https://i.picsum.photos/id/172/200/300.jpg"
  loadingComponent={<LoadingComponent />}
/>
```

Use with fixed height
```jsx
<AutoHeightImage
  src="https://i.picsum.photos/id/172/200/300.jpg"
  defaultHeight="200px"
/>
```

## Props
```js

interface AutoHeightImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {
  loadingComponent?: React.ReactNode,
  defaultHeight?: string,
}

```

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