Aspect Ratio

Keeps content at a fixed width-to-height ratio as the width changes, for images, video and maps.
Stable
Web
iOS
Android
@advui/core
Source

Image

The photo stays 16:9 at any width.

Installation

pnpm
pnpm add @advui/core
npm
npm install @advui/core

Usage

import { AspectRatio } from '@advui/core'

<AspectRatio ratio={16 / 9} borderRadius="lg">
  <Image source={{ uri }} style={{ width: '100%', height: '100%' }} accessibilityLabel="…" />
</AspectRatio>

Examples

Common ratios

1:1
4:3
16:9

API reference

AspectRatio

PropTypeDefaultDescription
rationumber1Width divided by height, e.g. `16 / 9`.
childrenReactNode—Content that fills the box: 100% width and height, or absolutely positioned.

Accessibility

  • A plain layout box with no role. Give images inside it a text alternative (alt on web, accessibilityLabel on native).

Responsive behavior

It is 100% wide by default, so its height follows the width at every breakpoint.

Platform notes

Web
Uses the CSS aspect-ratio property.
iOS
Uses the React Native aspectRatio style.
Android
Same as iOS.
Since v0.3.0Last updated Nov 2, 2026Edit this page on GitHub