Aspect Ratio
A container that maintains a fixed aspect ratio. Useful for images, videos, maps, and embeds.
Basic Usage
Image constrained to 16:9
Common Ratios
Different ratios with the same image
16:9 (default)
4:3
1:1 (square)
Portrait and Ultrawide
Portrait and ultrawide ratios
3:4 (portrait)
21:9 (ultrawide)
Props
| Prop | Type | Default | Description |
|---|---|---|---|
ratio |
string|number | '16/9' |
Aspect ratio value, e.g. "16/9", "4/3", "1/1", or 1.5 |
scope |
string|null | null |
Scoped personalization name |
The component renders as a <div> with overflow-hidden and position: relative. The native CSS aspect-ratio property handles the sizing. Children (images, videos, embeds) should use object-fit: cover and width: 100%; height: 100% to fill the container.
Keyboard Interaction
This component is a layout wrapper. Keyboard interaction is delegated to its children.