JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 335921
  • Score
    100M100P100Q182877F
  • License ISC

Responsive image component to fit perfectly itself.

Package Exports

  • react-native-fit-image

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-fit-image) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

React Native Fit Image npm version

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

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

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

// or draws image to specify size like Image component.
<FitImage
  source={{uri: 'http://facebook.github.io/react/img/logo_og.png'}}
  width={200}
  height={200}
  style={styles.fitImage}
/>

Example