component
avatar
Identity image, circular; initials/symbol fallback. Sizes via controlSize; needs label.
avatarprofileidentityimageinitialsshadcn
On iPad
The same installed source at a regular width. It adapts its layout without a separate design.
Install
With the sweetui tool (brew install mangobyte-dev/tap/sweetui):
sweetui install avatar --destination Sources/YourFeature/ComponentsInstalls 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
| Kind | component |
| Version | 0.2.1 |
| Platforms | iOS 26.0+ |
| Dependencies | none |
| Source | Registry/sources/components/Avatar.swift |
| Xcode preview | Avatar |