Aspect Ratio
Locks child content to a fixed width-to-height ratio. Built on reka-ui.
Default
16:9 image container that scales with its parent width.
Square
Set ratio=1 for square thumbnails.
API Reference
Props, events, and slots for each sub-component.
AspectRatio
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| ratio | number | 1 | Width-to-height ratio. 16/9 ≈ 1.78, 4/3 ≈ 1.33, 1 = square. |
| asChild | boolean | false | Render into the child element instead of a wrapper div. |