Skip to main content
Vuetify0 is now in alpha!
Vuetify0 Logo
Theme
Mode
Palettes
Accessibility
Vuetify One
Sign in to Vuetify One

Access premium tools across the Vuetify ecosystem — Bin, Play, Studio, and more.

Not a subscriber? See what's included

Avatar

Headless image component with automatic fallback to icon or text content.

Usage

The Avatar component provides a robust image loading system with automatic fallback handling. It manages multiple image sources with priority ordering and only displays the highest-priority loaded image or fallback content.

Anatomy

Anatomy
<script setup lang="ts">
  import { Avatar } from '@vuetify/v0'
</script>

<template>
  <Avatar.Root>
    <Avatar.Image />

    <Avatar.Fallback />
  </Avatar.Root>
</template>

Architecture

The Avatar uses an internal selection system with mandatory: 'force' to ensure exactly one element is always visible. Images register as disabled until they load successfully.

Tip

For single-source content images with placeholder and error fallback, use Image instead. Avatar specializes in identity / profile UIs with priority-based multi-source fallback.

Loading state slot props

Avatar.Image exposes the underlying loading state from useImage via slot props. Use these for custom transitions, retry UI, or status indicators.

Slot propPurpose
statusCurrent state: 'idle' | 'loading' | 'loaded' | 'error'
isLoadedTrue when the image has loaded successfully
isErrorTrue when the image failed to load
retryReset the image and re-attempt loading

Priority System

When multiple images are present, the priority prop determines display order. Higher priority images are preferred when loaded:

vue
<template>
  <Avatar.Root>
    <!-- Preferred when loaded -->
    <Avatar.Image src="/high-res.jpg" :priority="1" />

    <!-- Fallback image -->
    <Avatar.Image src="/low-res.jpg" :priority="0" />

    <!-- Text fallback -->
    <Avatar.Fallback>JD</Avatar.Fallback>
  </Avatar.Root>
</template>

API Reference

The following API details are for all variations of the Avatar component.

Avatar.Root

Props

namespace

string | undefined

Namespace for dependency injection

Default: "v0:avatar"

Slots

Avatar.Fallback

Props

namespace

string | undefined

Namespace for retrieving avatar context

Default: "v0:avatar"

Slots

default

AvatarFallbackSlotProps

Avatar.Image

Props

src

string | undefined

Image source URL

priority

number | undefined

Priority for display order (higher = more preferred)

Default: 0

namespace

string | undefined

Namespace for retrieving avatar context

Default: "v0:avatar"

Events

load

[e: Event]

error

[e: Event]

Slots

default

AvatarImageSlotProps
Was this page helpful?

Ctrl+/