Aspect Ratio
A container that maintains a specific aspect ratio for its content. This is useful for displaying images, videos, or any other media that needs to scale responsively while preserving its proportions. This example demonstrates a common 16:9 aspect ratio, perfect for video embeds or landscape images. The `Ratio` is calculated as `width / height`. This example shows a 1:1 aspect ratio, which creates a perfect square. The `Ratio` parameter is set to `1`.<div class="w-full max-w-md">
<RzAspectRatio Ratio="16.0 / 9.0">
<img src="/images/card1.jpg" alt="Image with 16:9 aspect ratio" class="rounded-md object-cover w-full h-full" />
</RzAspectRatio>
</div><div class="w-full max-w-xs">
<RzAspectRatio Ratio="1">
<div class="bg-muted rounded-md flex items-center justify-center w-full h-full">
<span class="text-muted-foreground">1:1 Aspect Ratio</span>
</div>
</RzAspectRatio>
</div>Property Description Type Default RatioThe desired aspect ratio, calculated as width / height. For example, a 16:9 ratio would be `16.0 / 9.0`. double1ChildContentThe content to be rendered inside the aspect ratio container. RenderFragment?null