# react-native-fit-image

> Responsive image component to fit perfectly itself.

Latest version **1.5.5** (published 2019-11-14) · Beerware license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.5 |
| Published | 2019-11-14 |
| First published | 2016-04-22 |
| Weekly downloads | 0 |
| License | Beerware |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 23 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 579 |
| Author | Jitae Kim |
| Maintainers | originerd, sunkibaek |
| Keywords | React, Native, Fit, Image, Responsive |

## Links

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

## Dependencies (1)

- [prop-types](https://npm.io/package/prop-types.md) ^15.5.10

## 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.5.5 (latest) — 2019-11-14
- 1.5.4 — 2017-11-05
- 1.5.3 — 2017-09-27
- 1.5.2 — 2017-07-29
- 1.5.1 — 2017-07-28
- 1.5.0 — 2017-07-20
- 1.4.9 — 2017-06-26
- 1.4.8 — 2017-04-12
- 1.4.7 — 2016-12-20
- 1.4.6 — 2016-11-28
- 1.4.5 — 2016-11-01
- 1.4.4 — 2016-10-28
- 1.4.3 — 2016-10-28
- 1.4.2 — 2016-10-28
- 1.4.1 — 2016-10-27
- … 10 more at https://npm.io/package/react-native-fit-image/versions

## README

# React Native Fit Image [![npm version](https://badge.fury.io/js/react-native-fit-image.svg)](https://badge.fury.io/js/react-native-fit-image)
React Native Fit Image enables you to draw responsive image component.

## Introduction
Responsive image component to fit perfectly itself.

## Install
`npm install react-native-fit-image --save`

## Usage
```javascript
import FitImage from 'react-native-fit-image';

// custom styles for FitImage
var styles = StyleSheet.create({
  fitImage: {
    borderRadius: 20,
  },
  fitImageWithSize: {
    height: 100,
    width: 30,
  },
});

// draws image to fit inherited space automatically, even when screen is rotated.
// even you don't need to provide original size in v1.2.0
<FitImage
  source={{ uri: 'https://facebook.github.io/react-native/docs/assets/favicon.png' }}
  style={styles.fitImage}
/>

// draws image to fit inherited space automatically and disables loading indicator
<FitImage
  indicator={false} // disable loading indicator
  indicatorColor="white" // react native colors or color codes like #919191
  indicatorSize="large" // (small | large) or integer
  source={{ uri: 'https://facebook.github.io/react-native/docs/assets/favicon.png' }}
  style={styles.fitImage}
/>

// draws image to fit inherited space automatically, even when screen is rotated.
<FitImage
  source={{ uri: 'https://facebook.github.io/react-native/docs/assets/favicon.png' }}
  originalWidth={400}
  originalHeight={400}
  style={styles.fitImage}
/>

// could use resizeMode
<FitImage
  resizeMode="contain"
  source={{ uri: 'https://facebook.github.io/react-native/docs/assets/favicon.png' }}
/>

// or draws image to specific size like Image component.
<FitImage
  source={{ uri: 'https://facebook.github.io/react-native/docs/assets/favicon.png' }}
  style={styles.fitImageWithSize}
/>

// draws local image (currently, it does not support responsive)
<FitImage
  source={require('fit-image.png')}
  style={styles.fitImageWithSize}
/>
```

## Example
- See a [FitImageExample][1].

![FitImageExample - Portrait](https://github.com/originerd/react-native-fit-image-example/raw/master/fit_image_example_portrait.gif)
![FitImageExample - LandScape](https://github.com/originerd/react-native-fit-image-example/raw/master/fit_image_example_landscape.gif)

[1]: https://github.com/originerd/react-native-fit-image-example

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