rn-image-auto-height
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.0%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: drcodemonster
- License: mit
- Language: JavaScript
- Default Branch: master
- Size: 401 KB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
rn-image-auto-height
this is a fork of vivaxy.. I just upgraded the package dependencies. Orginal npm package name was also changed from react-native-auto-height-image to rn-image-auto-height.
Initialized by vivaxy/gt-npm-package
This component provides you a simple way to load a remote image and automatically set Image height to the image dimension which fits the provided width.
React Native Image component needs users to set both width and height props.
React Native version requirements: >=0.72.6.
Installation
yarn add rn-image-auto-height
npm install rn-image-auto-height
Usage
Use local or remote files:
```js import React, { Component } from 'react'; import AutoHeightImage from 'rn-image-auto-height';
import image from 'gallifrey-falls.png';
export default class Demo extends Component {
render() {
return (
<AutoHeightImage
width={100}
source={image}
/>
<AutoHeightImage
width={100}
source={{uri: 'http://placehold.it/350x150'}}
/>
</View>
);
} } ```
You can even specify fallback images for when the source fails to load:
```js import React, { Component } from 'react'; import AutoHeightImage from 'rn-image-auto-height';
import image from 'gallifrey-falls.png';
export default class Demo extends Component {
render() {
return (
Props
| name | type | isRequired | default | description |
| --- | --- | --- | --- | --- |
| width | number | ✔ | N/A | image width to fit |
| maxHeight | number | ✖ | Infinity | image max height |
| source | number or object | ✔ | N/A | local (i.e. require/import) or remote image ({uri: '...'}) |
| fallbackSource | number or object | ✖ | N/A | local (i.e. require/import) or remote image ({uri: '...'}) |
| onHeightChange | func | ✖ | (height) => {} | called when updating image height, the argument height might be 0 |
| animated | bool | ✖ | false | Use Animated.Image instead of Image |
Other image props except resizeMode are accepted.
Change Log
Contributing
Licence
Contributors
Code Contributors
This project exists thanks to all the people who contribute. [Contribute].
Financial Contributors
Become a financial contributor and help us sustain our community. [Contribute]
Individuals
Organizations
Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]
Related Projects
Owner
- Name: DrCodeMonster
- Login: drcodemonster
- Kind: user
- Repositories: 2
- Profile: https://github.com/drcodemonster
Citation (CITATION.cff)
cff-version: 1.1.0
message: "If you use this software, please cite it as below."
authors:
- family-names: Xu
given-names: Ye
orcid: https://doi.org/10.5281/zenodo.7813210
title: vivaxy/rn-image-auto-height
version: v3.2.4
date-released: 2023-04-10
GitHub Events
Total
Last Year
Packages
- Total packages: 1
-
Total downloads:
- npm 13 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 1
- Total maintainers: 1
npmjs.org: rn-image-auto-height
react-native auto height image
- Homepage: https://github.com/drcodemonster/rn-image-auto-height#readme
- License: MIT
-
Latest release: 0.0.2
published over 2 years ago
Rankings
Maintainers (1)
Dependencies
- babel-preset-expo ^8.0.0 development
- expo ~49.0.0
- react 18.2.0
- react-dom 18.2.0
- react-native 0.72.6
- react-native-web ~0.19.9
- rn-image-auto-height file:..
- 1057 dependencies
- 835 dependencies
- @commitlint/cli ^12.0.0 development
- @commitlint/config-conventional ^12.0.0 development
- husky 6 development
- lint-staged ^11.0.0 development
- pinst ^2.1.4 development
- prettier ^2.0.0 development
- react ^18.2.0 development
- react-native ^0.72.6 development
- standard-version ^9.0.0 development
- prop-types ^15.7.2
- 835 dependencies