Leave Yamada UI a star

Star
Yamada UIYamada UIv1.5.1

AspectRatio

AspectRatio is a component for embedding things like videos and maps while maintaining the aspect ratio.

Source@yamada-ui/layouts

Import

import { AspectRatio } from "@yamada-ui/react"
Copied!

Usage

Editable example

<AspectRatio w="md" ratio={4 / 3}>
  <Image src="https://eiga.k-img.com/images/movie/100944/photo/14e876cfa5d3c633.jpg" />
</AspectRatio>
Copied!

Using iframe

Editable example

<AspectRatio w="full" ratio={16 / 9}>
  <iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d12974.591815632506!2d139.6932331!3d35.6117497!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x60188b1a487a026f%3A0x16e7e351187c8216!2z5qCq5byP5Lya56S-IOOCouODkOODg-ODlw!5e0!3m2!1sja!2sjp!4v1674728815443!5m2!1sja!2sjp" />
</AspectRatio>
Copied!

Edit this page on GitHub

PreviousDividerNextTypography