Home Aspect Ratio

The AspectRatio component ensures that an element maintains a specific width-to-height ratio. This is especially useful for responsive images, videos, or other content that needs to scale proportionally.

Installation

npm
npx phpxui add Aspect Ratio

Usage

use Lib\PHPXUI\{
    AspectRatio,
}
<AspectRatio ratio="16 / 9">
  <img src="..." alt="Image" class="rounded-md object-cover" />
</AspectRatio>