AspectRatio
Keeps its content at a fixed width-to-height ratio.
Import
import { AspectRatio } from "@tarve/core";Usage
import { AspectRatio, Image } from "@tarve/core";
<AspectRatio ratio={16 / 9} width={480}>
<Image src="assets/cover.png" fit="cover" />
</AspectRatio>Props
| Prop | Type | Default |
|---|---|---|
ratio required | number | — |
width | Style["width"] | 320 |
Common props
Shared by every component. See descriptions →
childrenhighlightidkeymotionFromonHighlightonPasteonTransitionEndrovingGroupstyle