Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Apple docs
Data displayApple

Image

Present native images with shared fit, ratio, radius, and accessibility behavior.

Public APILumenImageApple / SwiftUISwift product: LumenUI

Apple availability

Supported native targets

Import LumenUI in the target that uses this component. iPad support follows the iOS package baseline and uses native iPad layout behavior.

iPhone · iOS 16+iPad · iPadOS 16+Mac · macOS 13+Apple TV · tvOS 16+Apple Vision · visionOS 1+Apple Watch · watchOS 9+

Native example

Use Image

Use for product imagery that needs shared fitting, aspect ratio, radius, and labeling. Keep decoding, caching, network policy, placeholders, retries, and optimizer behavior in the application or platform loader.

Image rendered in the iPhone simulator Lumen playground
Verified runtime captureiPhone simulator
swift
LumenImage(
    aspectRatio: 16 / 9,
    fit: .cover,
    label: "Mountain valley at sunrise"
) {
    Image("mountain-valley").resizable()
}

Reference

Public API

The primary shared and platform-specific options exposed by LumenImage.

APIValues or typeDefaultDescription
contentNative image source or contentRequiredSupplies image pixels through the platform-native delivery path.
fitcontain · covercoverControls how the image fits its available bounds.
aspectRatioCGFloat?nilReserves a positive finite width-to-height ratio when provided.
radiusnone · sm · md · lg · fulllgClips the image with a shared semantic corner radius.
labelString?nilNames meaningful imagery; omit only for decorative images.

Native behavior

Design and accessibility

When to use it

Use for product imagery that needs shared fitting, aspect ratio, radius, and labeling. Keep decoding, caching, network policy, placeholders, retries, and optimizer behavior in the application or platform loader.

Accessibility

Images are decorative when their label is absent; a label exposes the complete image as one native accessibility element.

Shared component

Available on other platforms

React NativeAndroid / Compose
Apple docsSwiftUI package