Import
Basic Usage
Props
Source Props
The image source (either a remote URL or a local file resource). This prop can also contain several remote URLs, specified together with their width and height. The native side will then choose the best URI to display based on the measured size of the image container.Supported formats: png, jpg, jpeg, bmp, gif, webp (Android only), psd (iOS only)
A string representing the resource identifier for the image. Similar to src from HTML.
Similar to srcset from HTML. Specifies multiple image sources for different display densities.
Display Props
Determines how to resize the image when the frame doesn’t match the raw image dimensions.
cover- Scale the image uniformly (maintain aspect ratio) so that both dimensions will be equal to or larger than the corresponding dimension of the viewcontain- Scale the image uniformly so that both dimensions will be equal to or less than the corresponding dimension of the viewstretch- Scale width and height independently, may change the aspect ratio of the srcrepeat- Repeat the image to cover the frame of the view (iOS only)center- Scale the image down so that it is completely visible, if bigger than the view area
Width of the image component.
Height of the image component.
Styles to apply to the image.
Visual Props
The blur radius of the blur filter added to the image.
Changes the color of all the non-transparent pixels to the tintColor.
Accessibility Props
When true, indicates the image is an accessibility element.
The text that’s read by the screen reader when the user interacts with the image.
Alias for accessibilityLabel. The text that’s read by the screen reader when the user interacts with the image.
Alias for accessibilityLabel.
Network Props
Adds the CORS related header to the request. Similar to crossorigin from HTML.
A string indicating which referrer to use when fetching the resource. Similar to referrerpolicy from HTML.Options: ‘no-referrer’, ‘no-referrer-when-downgrade’, ‘origin’, ‘origin-when-cross-origin’, ‘same-origin’, ‘strict-origin’, ‘strict-origin-when-cross-origin’, ‘unsafe-url’
Event Handlers
Invoked when load completes successfully. Event data includes the image source dimensions and URI.
Invoked on load start.
Invoked when load either succeeds or fails.
Invoked on load error with
{nativeEvent: {error}}.Invoked on mount and layout changes with
{nativeEvent: { layout: {x, y, width, height}}}.Identification Props
A unique identifier for this element to be used in UI Automation testing scripts.
Platform-Specific Props
- iOS
- Android
A static image to display while loading the image source.
Invoked when a partial load of the image is complete.
Invoked on download progress with
{nativeEvent: {loaded, total}}.When the image is resized, the corners specified by capInsets will stay a fixed size, but the center content and borders will be stretched.