AspectRatio
Maintain fixed aspect ratio
Import: import { AspectRatio } from 'react-native-mantine';
Usage
import { AspectRatio, Image } from 'react-native-mantine';
<AspectRatio ratio={16 / 9}>
<Image source={{ uri: 'https://unsplash.it/640/360' }} fit="cover" />
</AspectRatio>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
ratio (required) | number | 1 | Aspect ratio, e.g., 16/9, 4/3, 1 |
children | React.ReactNode | Children to render inside aspect ratio container | |
style | any | Additional styles | |
testID | string | Test identifier used by testing frameworks |