Aspect Ratio

Locks content to a fixed width-to-height ratio. Useful for media, embeds, and placeholders that need to keep their proportions across viewport sizes.

16 / 9

Installation

Props

Built on Radix UI Aspect Ratio.

PropTypeDefaultDescription
ratio
number1The desired aspect ratio (e.g. 16/9, 4/3, 1).
asChild
booleanfalseRenders as the child via Radix Slot.