A utility component for constraining content to a fixed width-to-height ratio.
The component can be imported via:
AspectRatio constrains its content to a fixed width-to-height ratio. It fills
the width of its container and derives its height from the ratio prop, making
it useful for responsive images, video embeds, maps, and placeholders.
The single child stretches to fill the container.
The ratio prop accepts a number expressed as width / height. For example,
16 / 9 produces a widescreen container, 1 a square, and 3 / 4 a portrait.
When omitted, it defaults to 1.
Images and videos placed inside AspectRatio are stretched to fill the
container and use object-fit: cover, so they crop rather than distort.
AspectRatio fills the width of its container, so constrain the container (for
example with the style prop) to limit its overall size.
PlumaAspectRatio extends BoxDefault:1
The aspect ratio (width / height) of the container, e.g. 16 / 9 for
widescreen or 1 for a square.