https://github.com/rintoj/native-x-image
https://github.com/rintoj/native-x-image
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/rintoj/native-x-image
- Owner: rintoj
- Created: 2021-02-04T06:44:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-10T10:28:50.000Z (almost 5 years ago)
- Last Synced: 2025-02-05T17:19:55.271Z (over 1 year ago)
- Language: TypeScript
- Size: 170 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# native-x-image
[](https://github.com/semantic-release/semantic-release)
Wrap this component around another component to enable user interaction
## Install
### Yarn
```sh
yarn add native-x-image
```
### NPM
```sh
npm install native-x-image
```
Note: This module uses react-native-fast-image internally. Make sure you have it configured.
See: [`react-native-fast-image`](https://github.com/DylanVann/react-native-fast-image#usage)
## Usage
```tsx
import { Image } from 'native-x-image'
function MyComponent() {
const onTap = () => {
// handle action
}
return
}
// or with local
function MyComponent({ user }: { user: User }) {
const onTapUser = (user: User) => {
// handle action
}
return
}
```
## API
| Property | Default Value | Usage |
| ---------------------- | ------------- | --------------------------------------------- |
| source: Source | | Image to show |
| fill?: boolean | false | Fill width of the container |
| width?: number | | Width of the image |
| height?: number | | Height of the image |
| resizeMode: ResizeMode | 'fill' | Valid values: contain, cover, stretch, center |
| fallbackSource: Source | | Image to show when the image is not available |
And all properties from:
- [`react-native-fast-image`](https://github.com/DylanVann/react-native-fast-image#properties)
## Automatic Release
Here is an example of the release type that will be done based on a commit messages:
| Commit message | Release type |
| ------------------- | --------------------- |
| fix: [comment] | Patch Release |
| feat: [comment] | Minor Feature Release |
| perf: [comment] | Major Feature Release |
| doc: [comment] | No Release |
| refactor: [comment] | No Release |
| chore: [comment] | No Release |