Components › Display
Aspect ratio
Keeps media at a fixed shape as the width changes. Images and video inside crop to fill it.
Installation
npx plankui@latest add aspect-ratioUsage
import { AspectRatio } from "@/components/ui/aspect-ratio";
<AspectRatio ratio={16 / 9} className="rounded-card">
<img src="/cover.jpg" alt="" />
</AspectRatio>API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| ratio | number | 16 / 9 | Width divided by height. |