recipe
aspect-ratio
Native aspectRatio guidance.
aspect-ratiolayoutmedianativeguidance

On iPad
The same installed source at a regular width. It adapts its layout without a separate design.


Install
Nothing to install
Copy the snippet below. The native API is the whole treatment.
Usage
Color.indigo
.overlay {
Image(systemName: "play.fill")
.foregroundStyle(.white)
.accessibilityHidden(true)
}
.aspectRatio(16.0 / 9.0, contentMode: .fit)
.accessibilityLabel("Video placeholder")
.registryItem("aspect-ratio")
Color.teal
.aspectRatio(1, contentMode: .fit)
.frame(maxWidth: 160)
.accessibilityLabel("Avatar placeholder")Why native is enough
aspectRatio(_:contentMode:) at call site; no wrapper; preserves parent layout proposals.
Accessibility contract
- No accessibility semantics change.
- Caller keeps labels, decorative hiding.
Details
| Kind | recipe |
| Version | 0.3.1 |
| Platforms | iOS 26.0+ |
| Dependencies | none |
| Source | none (native guidance) |