Components
Aspect Ratio

Aspect Ratio

Displays content within a desired ratio.

Ratio : 16/9
Cùng lập quỹ nhóm với MoMo
Ratio : 1/1
Nhập hội U22, Lotte Cinema đồng giá 65.000Đ/vé phim 2D khi thanh toán với MoMo!
Ratio : 7/10 (Poster movie)
Quật Mộ Trùng Ma
ℹ️

To ensure consistency in image sizes across the website, the following aspect ratios will be prioritized: 16/9 , 1/1 , 4/3 , 2/3 , 7/10 , 3/2 , 5/2, 8/3, 8/5

Usage

import {
  AspectRatio,
} from "@momo-webplatform/mobase";
<AspectRatio ratio={16 / 9} className="bg-gray-100">
  <img
      src="https://homepage.momocdn.net/img/momo-amazone-s3-api-240826102539-638602647398348446.jpg"
      loading='lazy'
      alt="Cùng lập quỹ nhóm với MoMo"
      className="h-full w-full object-cover"
    />
</AspectRatio>

API Reference

AspectRatio component extends Radix Aspect Ratio (opens in a new tab) component and supports all of its props.

AspectRatio
PropTypeDefaultRequired
ratio
number--false
asChild
enumboolean--false

Features

  • Accepts any custom ratio.
  • All images used on the website and in articles, blogs, videos, posters, will adhere to the predefined aspect ratios mentioned above