Avatar

A component that displays a profile picture, initials or fallback icon for a user.

Preview

Avatar Preview

Code Example

let model = AvatarVM {
  $0.imageSrc = .local("avatar_image")
  $0.placeholder = .icon("avatar_placeholder")
  $0.cornerRadius = .full
  $0.size = .large
  $0.color = .success
}

API

AvatarVM Props

A model that defines the appearance properties for an avatar component.

NameTypeDefaultDescription
colorComponentColor?nilThe color of the placeholder.
cornerRadiusComponentRadiusfullThe corner radius of the avatar.
imageSrcImageSource?nilThe source of the image to be displayed.
placeholderPlaceholder.icon("avatar_placeholder")The placeholder that is displayed if the image is not provided or fails to load.
sizeComponentSizemediumThe predefined size of the avatar.

SUAvatar

public init(model: AvatarVM)

UKAvatar

Initializers

public init(model: AvatarVM)

Public Properties

NameTypeDescription
modelAvatarVMA model that defines the appearance properties.