Skip to content

Avatar

A person's picture or initials, in five sizes and two shapes, and a group that overlaps them.

  • .aparte-avatar
On this page
Open

.aparte-avatar stands for a person: their picture (.aparte-avatar__image), or their initials when there is none. It is the same object as a message’s avatar, so a size set here resizes the chat’s avatars too. --xs to --xl size it, --circle and --square shape it, and .aparte-avatar-group overlaps several, with a +3 for the rest.

The corner, the initials and the overlap are fractions of the size, so they stay in proportion whatever size you pick.

VariableDefaultNote
--aparte-avatar-size32pxAvatars
--aparte-avatar-initials-ratio0.34
--aparte-avatar-radius-ratio0.28
--aparte-avatar-overlap-ratio0.28
--aparte-avatar-image-usernone
--aparte-avatar-image-assistantnone
--aparte-avatar-image-size90%
--aparte-avatar-size-xs20px
--aparte-avatar-size-sm24px
--aparte-avatar-size-lg40px
--aparte-avatar-size-xl56px
--aparte-avatar-fallback-bgvar(--aparte-surface-3)
--aparte-avatar-fallback-colorvar(--aparte-text)
--aparte-avatar-group-ring-widthcalc(var(--aparte-border-width) * 2)
--aparte-avatar-group-ring-colorvar(--aparte-surface-1)
--aparte-avatar-error-ring0 0 0 2px var(--aparte-error-solid)The error ring on an avatar.
--aparte-avatar-bg-uservar(--aparte-primary)
--aparte-avatar-text-uservar(--aparte-text-inverse)
--aparte-avatar-bg-assistantvar(--aparte-surface-3)
--aparte-avatar-text-assistantvar(--aparte-text)

To put avatars on the chat’s messages, see setAvatarProvider() on the Message page.

.aparte-avatar · .aparte-avatar--circle · .aparte-avatar--lg · .aparte-avatar--sm · .aparte-avatar--square · .aparte-avatar--xl · .aparte-avatar--xs · .aparte-avatar-group · .aparte-avatar__image

  • A picture needs an alt that names the person; initials alone may need an aria-label with the full name.
  • In a group, the +3 should say what it counts (“3 more people”).
  • Message — avatars beside the conversation.
  • Thumbnail — the same tile for a file instead of a person.