Avatars

Represent a user or entity with an image, initials, or icon across a range of sizes and shapes, and combine several into a stacked group.

Avatar Sizes
Avatar with Status
Avatar Group
Usage
<script setup lang="ts">
import { VdAvatar } from "@vanduo-oss/vd3";
</script>

<template>
  <VdAvatar initials="AL" />
  <VdAvatar src="/ada.jpg" alt="Ada Lovelace" size="lg" status="online" />
  <VdAvatar initials="JS" variant="success" shape="rounded" />
  <VdAvatar initials="AB" variant="danger" shape="square" size="xl" />
</template>
API Reference

CSS Classes

Class NameDescriptionType
.vd-avatarBase component class required for all VD3 UI avatars.Component
.vd-avatar-[size]Size modifier class (e.g., -xs, -sm, -lg, -xl, -2xl). Defaults to medium if omitted.Modifier
.vd-avatar-status-[status]Adds a status indicator badge (e.g., -online, -offline, -busy, -away).Modifier
.vd-avatar-groupWrapper class for grouping multiple avatars together with overlapping margins.Layout

Component API (Vue 3)

PropDescription
:src / :altImage source and alt text.
:initialsFallback initials shown when there is no image.
:sizexs | sm | md | lg | xl | 2xl (default md).
:variantInitials background colour: primary | secondary | success | warning | error | danger | info (default primary).
:shapecircle | rounded | square (default circle).
:statusonline | offline | away | busy — renders a presence dot.
Accessibility
  • Always pass a descriptive :alt when using :src so screen readers announce the person or entity represented by the image.
  • When rendering initials without an image, VdAvatar exposes role="img" and uses :alt (falling back to :initials) as its aria-label.
  • Presence status dots (online, offline, busy, away) are visual indicators; convey critical availability state in adjacent text or an accessible label.