Skip to content

Avatar

User avatar display, supporting image and text fallback.

Basic Usage

Load images via src. Falls back to text initials on load failure.

UOJDJS
vue
<AAvatar alt="User One" />
<AAvatar alt="John Doe" />
<AAvatar alt="Jane Smith" />

Size

Support sm, md, lg sizes.

AAA
vue
<AAvatar alt="A" size="sm" />
<AAvatar alt="A" size="md" />
<AAvatar alt="A" size="lg" />

Shape

Support circle (default) and square shapes.

CISQ
vue
<AAvatar alt="Circle" shape="circle" />
<AAvatar alt="Square" shape="square" />

Custom Fallback

Customize fallback text with fallback.

UJD
vue
<AAvatar fallback="U" />
<AAvatar fallback="JD" />

API

Props

NameTypeDefaultDescription
srcstringImage URL
altstringAlt text, also used for initials
size'sm' | 'md' | 'lg''md'Size
shape'circle' | 'square''circle'Shape
fallbackstringCustom fallback text

MIT License