SweetUI

Search items

Jump to an item

component

avatar

Identity image, circular; initials/symbol fallback. Sizes via controlSize; needs label.

avatarprofileidentityimageinitialsshadcn
avatar, light

On iPad

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

avatar on iPad, light

Install

With the sweetui tool (brew install mangobyte-dev/tap/sweetui):

sweetui install avatar --destination Sources/YourFeature/Components

Installs in order: avatar 0.2.1. Point --destination at a folder inside the consuming target's sources.

Usage

Avatar(Image("maya"), accessibilityLabel: Text("Maya Khalid"))

Avatar(initials: "MK", accessibilityLabel: Text("Maya Khalid"))
    .controlSize(.large)

Avatar(accessibilityLabel: Text("Unknown sender"))

Accessibility contract

  • MUST supply label; none from face/monogram.
  • One image-trait element; ignores inner text/symbol.
  • Initials: tint/surface fill; scales with body text.
  • Diameter: controlSize, 24-72pt default; border: semantic token.

Details

Kindcomponent
Version0.2.1
PlatformsiOS 26.0+
Dependenciesnone
SourceRegistry/sources/components/Avatar.swift
Xcode previewAvatar