Skip to content

Avatar ​

Circular avatar showing centered initials on a neutral fill, with an optional success presence dot bottom-right. There is no network image loading here — the initials fallback is the only rendering; use Coil/AsyncImage at the call site for real photos. Use PrismAvatarGroup to stack several avatars with a "+N" overflow chip.

Import ​

kotlin
import io.github.heartcoolman.prism.ui.PrismAvatar
import io.github.heartcoolman.prism.ui.PrismAvatarGroup

Basic usage ​

kotlin
PrismAvatar(name = "Jane Doe", online = true)

Sizes ​

kotlin
PrismAvatar(name = "Al", size = PrismAvatarSize.Small)
PrismAvatar(name = "Bo", size = PrismAvatarSize.Medium)
PrismAvatar(name = "Cy", size = PrismAvatarSize.Large)

Group ​

PrismAvatarGroup overlaps avatars left-to-right; beyond max, the remainder collapses into a trailing "+N" chip.

kotlin
PrismAvatarGroup(names = listOf("Al", "Bo", "Cy", "Di"), max = 3)

API ​

PrismAvatar ​

ParameterTypeDefaultDescription
nameString""Display name; first 1-2 characters become the uppercased initials.
modifierModifierModifierModifier applied to the avatar box.
sizePrismAvatarSizePrismAvatarSize.MediumDiameter preset (small 28 / medium 40 / large 56).
onlineBooleanfalseShows a success presence dot bottom-right.

PrismAvatarGroup ​

ParameterTypeDefaultDescription
namesList<String>—Names to stack, overlapping left-to-right.
modifierModifierModifierModifier applied to the group layout.
maxInt?nullShow the first N avatars, then a "+N" overflow chip; null shows all.
sizePrismAvatarSizePrismAvatarSize.MediumDiameter preset applied to every avatar.

PrismAvatarSize ​

ValueDiameter
Small28dp
Medium40dp
Large56dp

Released under the MIT License.