ProImage
React native progressive image component.
Install
$ npm i pro-imageor$ yarn add pro-image
Usage
Simple example:
;const MyImageComponent =<ProImagethumbnail= uri: 'lorem.ipsum/thumbnail.png'image= uri: 'lorem.ipsum/big-image.png'/>
Properties
Property | Is optional? | Default | Description |
---|---|---|---|
image | no | - | Image to render. |
thumbnail | yes | null | The image to render with the same aspect ratio and the smallest resollution possible. |
placeholder | yes | null | Placeholder image to render while the image is loading. (Note: placeholder will not show if there's a thumbnail) |
resizeMode | yes | cover | Image resize mode. |
style | yes | {} | Styles for the image. |
containerStyle | yes | {} | Styles for the image container (View). |
duration | yes | 1000 (ms) | Time in milliseconds that the fade effects lasts. |
Full example:
;;const MyImageComponent =<ProImageplaceholder=placeholderthumbnail= uri: 'lorem.ipsum/thumbnail.png'image= uri: 'lorem.ipsum/big-image.png'containerStyle= margin: 4style= height: 100 width: 200resizeMode="contain"/>
Global properties
Set global values to all the images in your app.
Properties
Property | Defalut | Description |
---|---|---|
duration | 1000 (ms) | Time in milliseconds that the fade effects lasts. |
placeholder | null | Placeholder image. |
blur | 1 | Blur radius for the thumbnail. |
Usage
Customize all options:
;;ProImage;
Changing just one value:
;ProImage;