Koori UI
Components

GlassAspectRatio

Constrain content to a fixed width-to-height ratio.

Preview

16:9

Usage

import { GlassAspectRatio } from "koori-ui";
 
<GlassAspectRatio ratio={16 / 9}>
  <img src="/cover.jpg" alt="" className="h-full w-full object-cover" />
</GlassAspectRatio>

Props

PropTypeDefaultDescription
rationumber1Width divided by height (e.g. 16 / 9)

All native <div> props are also accepted.

On this page