Set the ratio and put the media inside, so the box keeps its shape before the photo loads.
The sample also uses Image. One command adds them with this item:
article-cover.tsx
AspectRatio
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| ratio | number | — | Width divided by height: 16 / 9, 4 / 3, 1, 9 / 16. |
| animate | boolean | false | Move to a new ratio on a spring. Default false: the box takes a new ratio at once, as a plain server-rendered div. |
| mode | "crop""page" | — | With animate, how a new ratio shows. page (default): the box height moves, and layout runs each frame, so the content below flows with it. crop: the box keeps a fixed frame, and a clip-path: inset moves; no layout runs, so nothing below moves. |
| frame | number | — | With animate and mode="crop": the ratio of the fixed frame. Default 1: a square holds the contain box of every ratio. For a set of presets, use clamp(1, smallest, largest): 4:3 to 21:9 gives 4 / 3, and 16:9 with 9:16 gives 1. |
| transition | SpringConfig | — | With animate: the spring (SpringConfig, physics or time form). Default glide (stiffness 700, damping 53, no overshoot, within 0.5% at about 280ms). A time spring runs as its physics twin, so it keeps its speed when a new ratio comes mid-move. |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |





