# react-native-image-auto-height

> This component provides you with an easy way to automatically set the height of the image to the provided width without using additional props

Latest version **1.0.4** (published 2021-04-06) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2021-04-06 |
| First published | 2021-04-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Maxim Boyanov |
| Maintainers | syysbiir |
| Keywords | react-native, react-native-image-auto-height, image, auto-height |

## Links

- npm: https://www.npmjs.com/package/react-native-image-auto-height
- Repository: https://github.com/SyysBiir/react-native-image-auto-height
- Homepage: https://github.com/SyysBiir/react-native-image-auto-height#readme
- Issues: https://github.com/SyysBiir/react-native-image-auto-height/issues
- npm.io page: https://npm.io/package/react-native-image-auto-height

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2021-04-06
- 1.0.3 — 2021-04-06
- 1.0.2 — 2021-04-06
- 1.0.1 — 2021-04-06
- 1.0.0 — 2021-04-06

## README

# react-native-image-auto-height
[![npm](https://img.shields.io/npm/v/github-buttons)](https://www.npmjs.com/package/react-native-image-auto-height)

This component provides you with an easy way to automatically set the height of the image to the provided width without using additional props.

## Features
 - Can be used in the same way as an `Image` component from react-native, no extra props
 - All common props of component `Image` from react-native are supported
 - Auto height setting with CSS-like styles

## Install
To install the module, run the following in the command line:
```bash
npm i react-native-image-auto-height --save
```

## Usage

```js
import React, { Component } from 'react';
import { StyleSheet } from 'react-native';
import Image from 'react-native-image-auto-height';

export default class Demo extends Component {
  render() {
    return (
      <>
        <Image
          style={styles.image}
          source={require('./image.png')}
        />

        <Image
          style={styles.image}
          source={{uri: 'http://placehold.it/350x150'}}
        />

      </>
    );
  }
}

const styles = StyleSheet.create({
    image: {
        width: 150,
        height: 'auto'
    }
});
```

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