Image
Image wrapper with extra functionality like source transform and assets support
(code example)
This component extends Image props.
This component support margin modifiers.
please note that for SVG support you need to add both react-native-svg
and react-native-svg-transformer
and also configure them (see metro.config.js
)
Usageβ
<Image width={50} height={50} source={{uri: 'https://images.pexels.com/photos/748837/pexels-photo-748837.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260'}}/>
APIβ
aspectRatioβ
The aspect ratio for the image
number
assetGroupβ
the asset group, default is icons
string
assetNameβ
if provided image source will be driven from asset name
string
coverβ
Show image as a cover, full width, image (according to aspect ratio, default: 16:8)
boolean
customOverlayContentβ
Render an overlay with custom content
JSX.Element
errorSourceβ
Default image source in case of an error
ImageSourcePropType
imageIdβ
An imageId that can be used in sourceTransformer logic
string
overlayColorβ
Pass a custom color for the overlay
string
overlayIntensityβ
OverlayIntensityType
LOW | MEDIUM | HIGH
overlayTypeβ
the image MUST have proper size, see examples in: https://github.com/wix/react-native-ui-lib/blob/master/demo/src/screens/componentScreens/OverlaysScreen.tsxβ
The type of overlay to place on top of the image.
VERTICAL | TOP | BOTTOM | SOLID
recorderTagβ
Recorder Tag
'mask' | 'unmask'
sourceTransformerβ
custom source transform handler for manipulating the image source (great for size control)
(props: any) => ImageSourcePropType
supportRTLβ
whether the image should flip horizontally on RTL locals
boolean
tintColorβ
the asset tint
string
useBackgroundContainerβ
Use a container for the Image, this can solve issues on Android when animation needs to be performed on the same view; i.e. animation related crashes on Android.
boolean