Skip to content

Avatar ​

An image element with a fallback for representing the user.

Examples ​

Default ​

CN
vue
<script setup>
import { Avatar, AvatarFallback, AvatarGroup, AvatarImage } from '@empathyds/vue'
</script>

<Avatar>
  <AvatarImage src="https://github.com/radix-vue.png" alt="@radix-vue" />
  <AvatarFallback>CN</AvatarFallback>
</Avatar>

Avatar Group ​

RVVJVT
vue
<script setup>
import { Avatar, AvatarFallback, AvatarGroup, AvatarImage } from '@empathyds/vue'
</script>

<AvatarGroup>
  <Avatar>
    <AvatarImage src="https://github.com/radix-vue.png" alt="@radix-vue" />
    <AvatarFallback>RV</AvatarFallback>
  </Avatar>
  <Avatar>
    <AvatarImage src="https://github.com/vuejs.png" alt="@vuejs" />
    <AvatarFallback>VJ</AvatarFallback>
  </Avatar>
  <Avatar>
    <AvatarImage src="https://github.com/vitejs.png" alt="@vitejs" />
    <AvatarFallback>VT</AvatarFallback>
  </Avatar>
</AvatarGroup>

Custom Size ​

RVVJ
vue
<script setup>
import { Avatar, AvatarFallback, AvatarGroup, AvatarImage } from '@empathyds/vue'
</script>

<AvatarGroup :size="48">
  <Avatar>
    <AvatarImage src="https://github.com/radix-vue.png" alt="@radix-vue" />
    <AvatarFallback>RV</AvatarFallback>
  </Avatar>
  <Avatar>
    <AvatarImage src="https://github.com/vuejs.png" alt="@vuejs" />
    <AvatarFallback>VJ</AvatarFallback>
  </Avatar>
</AvatarGroup>

Props ​

AvatarGroup ​

PropTypeDefaultDescription
maxnumber5Maximum number of avatars to show before "+X" indicator.
sizenumber32Size of the avatars in pixels.

AvatarImage ​

PropTypeDefaultDescription
srcstring-The source of the image.
altstring-The alt text of the image.

AvatarFallback ​

PropTypeDefaultDescription
delayMsnumber-Useful for delaying rendering so it only appears for those with slower connections.

Slots ​

Avatar ​

SlotDescription
defaultThe content of the avatar (Image and Fallback).

AvatarGroup ​

SlotDescription
defaultThe Avatar components to display as a group.

AvatarFallback ​

SlotDescription
defaultThe content of the fallback (e.g. initials).