Aspect Ratio
stableConstrains content to a desired width / height ratio.
Basic usage
16:9
Examples
Portrait and square
Use different ratios for portrait (4/5) and square (1/1) crops.
4:5
1:1
Media cards
AspectRatio keeps image, video and preview tiles stable across responsive widths.
4:3 preview area
Features
- Any ratio.
- Works with images or any node.
Installation
bash
pnpm dlx structyl add aspect-ratioAPI Reference
Aspect Ratio API reference
Full props, types, defaults.