Display

SKAvatar

SKAvatar renders a user identity at five sizes with graceful fallback: image, then initials derived from the display name, then a generic icon. An optional presence dot supports collaboration surfaces.

Experimentalsince 1.6.0Compose · XML plannedAll components

Not yet released. SKAvatar is planned for 1.6.0; the current published release (1.4.0-alpha01) ships SKText and SKTextField only.

Usage

SKAvatar.kt
SKAvatar(
    name = "Subodh Gupta",
    imageUrl = user.photoUrl,
    size = SKAvatarSize.Large,
    presence = SKPresence.Online
)

Props

PropTypeDefaultDescription
nameString—Used for initials fallback.
imageUrlString?nullRemote image source.
sizeSKAvatarSizeMediumXSmall through XLarge.

Accessibility

Decorative by default; pass contentDescription when the avatar is the only identity cue.

Theming

Fallback background derives deterministically from the name hash within the palette.

API surface

  • SKAvatar
  • SKAvatarSize
  • SKPresence

Related