@ovok/native/image

Optimized image component.

  • Stable unknown
  • Release candidate since 1.16.1-rc.3
  • Development since 1.16.1-dev.2111+9796905

Optimized image component.

Import from @ovok/native/image.

Components

OptimizedImage

const OptimizedImage: MemoExoticComponent<(__namedParameters) => Element>;

Image that requests an Ovok-resized version for its on-screen size, retries on failure and can show a fallback.

Interfaces

OptimizedImageProps

Props for OptimizedImage; also accepts expo-image props except source and style.

Extends

  • Omit<ImageProps, "source" | "style">

Properties

PropertyTypeDescription
aspectRatio?numberWidth-to-height ratio of the image.
containerStyle?StyleProp<ViewStyle>Style for the wrapping container.
fallback?anyImage shown after the bounded expo-image retry policy is exhausted.
fit?"fill" | "contain" | "cover" | "inside" | "outside"How the image fits its box.
height?ImageDimensionImage height.
maxRetries?numberNumber of retries attempted by expo-image before the fallback is shown.
style?Omit<StyleProp<ImageStyle & object>, "height" | "aspectRatio" | "width" | "contentFit">Image style, excluding size and fit, which have their own props.
uristringSource URL of the image.
width?ImageDimensionImage width.

Type Aliases

ImageDimension

type ImageDimension = number | `${number}%` | "auto";

A size in pixels, a percentage string such as "50%", or "auto".

Last updated on

On this page