avatar

Avatar

A person's picture with initials or an icon as fallback and an optional status badge; a group overlaps several and shows how many more there are.

Parts

PartFileDoes
AvatarAvatar.vueGroups the image, fallback and badge of an avatar.
AvatarBadgeAvatarBadge.vueShows a small status marker on the corner of the avatar.
AvatarFallbackAvatarFallback.vueShows initials or an icon when the avatar image is missing or fails to load.
AvatarGroupAvatarGroup.vueStacks several avatars in an overlapping row.
AvatarGroupCountAvatarGroupCount.vueShows how many more avatars the group holds than it displays.
AvatarImageAvatarImage.vueShows the picture of the avatar.

Anatomy

<AvatarGroup>
  <Avatar>
    <AvatarImage />
    <AvatarFallback />
    <AvatarBadge />
  </Avatar>
  <AvatarGroupCount />
</AvatarGroup>

Styling

All of Avatar’s styles live in avatar.json. New to styling in Frontic UI? How styling works →

Install

npm packages
@vueuse/core
class-variance-authority
reka-ui

API reference

Avatar.vue

Groups the image, fallback and badge of an avatar. Renders a <span>.

Props 2

PropTypeDefault
classClassValue—
sizeAvatarSize—

Data attributes 1

Data attributeValues
data-size'md' | 'sm' | 'lg'

Recipe avatar 4 groups

Recipe avatar-ring 1 group

AvatarBadge.vue

AvatarFallback.vue

AvatarGroup.vue

AvatarGroupCount.vue

AvatarImage.vue
Avatar