Skip to main content
161

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Apple docs
Data displayApple

Avatar

Display a native image or fallback identity at shared avatar sizes.

Public APILumenAvatarApple / 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 Avatar

Keep image sources native to the platform. Use initials or a short fallback when no image is available.

Avatar rendered in the iPhone simulator Lumen playground
Verified runtime captureiPhone simulator
swift
LumenAvatar(
    fallback: "SM",
    size: .lg,
    label: "Santiago Molina"
)

Reference

Public API

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

APIValues or typeDefaultDescription
imageImage?nilProvides the platform-native image source.
fallbackString?Provides fallback text, normally initials.
sizesm · md · lgmdUses a 32, 40, or 56 unit diameter.
labelString?nilNames an identity-bearing avatar.

Native behavior

Design and accessibility

When to use it

Keep image sources native to the platform. Use initials or a short fallback when no image is available.

Accessibility

Supply a label when the avatar conveys identity. Omit it when the same name appears adjacent and the image is decorative.

Shared component

Available on other platforms

React NativeAndroid / Compose
Apple docsSwiftUI package