Aspect Ratio

Locks child content to a fixed width-to-height ratio via bits-ui AspectRatio. Pure layout — no motion, no state. Pairs naturally with images, video, and embedded iframes.

Usage

16 : 9

Common ratios

1 : 1
1 : 1
4 : 3
4 : 3
16 : 9
16 : 9
21 : 9
21 : 9

API reference

Inherits bits-ui AspectRatio.Root props.

PropTypeDescription
numberWidth / height ratio. Pass numeric expressions like 16 / 9 or 4 / 3 — numbers, not strings.
stringMerged onto the wrapper via tailwind-merge.
HTMLElement | nullTwo-way-bindable element reference.