Aspect Ratio
Container that locks child content to a fixed width-to-height ratio via CSS custom property.
Default
16:9
Cinematic
21:9
Portrait
3:4
Square
1:1
Thumbnail
4:3 thumbnail
Installation
npx shadcn@latest add @byronwade/aspect-ratioProps
| Prop | Type | Default | Description |
|---|---|---|---|
| ratio | number | — | Width divided by height (e.g. 16/9, 1, 4/3). |
| className | string | — | Additional classes merged onto the root. |