# @ovok/native/image

Canonical page: https://docs.ovok.com/native-sdk/reference/image

Optimized image component.

Import from `@ovok/native/image`.

## Components [#components]

### OptimizedImage [#optimizedimage]

```ts
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 [#interfaces]

### OptimizedImageProps [#optimizedimageprops]

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

#### Extends [#extends]

- `Omit`\<`ImageProps`, `"source"` \| `"style"`\>

#### Properties [#properties]

| Property | Type | Description |
| ------ | ------ | ------ |
| <a id="property-aspectratio"></a> `aspectRatio?` | `number` | Width-to-height ratio of the image. |
| <a id="property-containerstyle"></a> `containerStyle?` | `StyleProp`\<`ViewStyle`\> | Style for the wrapping container. |
| <a id="property-fallback"></a> `fallback?` | `any` | Image shown after the bounded expo-image retry policy is exhausted. |
| <a id="property-fit"></a> `fit?` | `"fill"` \| `"contain"` \| `"cover"` \| `"inside"` \| `"outside"` | How the image fits its box. |
| <a id="property-height"></a> `height?` | [`ImageDimension`](#imagedimension) | Image height. |
| <a id="property-maxretries"></a> `maxRetries?` | `number` | Number of retries attempted by expo-image before the fallback is shown. |
| <a id="property-style"></a> `style?` | `Omit`\<`StyleProp`\<`ImageStyle` & `object`\>, `"height"` \| `"aspectRatio"` \| `"width"` \| `"contentFit"`\> | Image style, excluding size and fit, which have their own props. |
| <a id="property-uri"></a> `uri` | `string` | Source URL of the image. |
| <a id="property-width"></a> `width?` | [`ImageDimension`](#imagedimension) | Image width. |

## Type Aliases [#type-aliases]

### ImageDimension [#imagedimension]

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

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