Avatar Component

An image element with a fallback for representing a user or entity.

Basic Usage

Display a user avatar with automatic fallback to initials.

Mathew SH User JD

Size Variants

Avatars come in four different sizes.

XS Small
MD Default
LG Large
XL Extra Large

With Images

Display actual user profile images with fallback support.

Vercel VC Microsoft MS Google GG

With Icons

Use icons as fallback content for generic user representations.

User List

Common pattern for displaying a list of users or team members.

JD

John Doe

john.doe@example.com

AS

Alice Smith

alice.smith@example.com

BJ

Bob Johnson

bob.johnson@example.com

Avatar Group

Stack avatars to show multiple users or team members compactly.

AB CD EF GH +5

Custom Styles

Customize avatar appearance with additional CSS classes.

AB CD EF GH

With Status Indicator

Add status indicators to show online/offline/busy states.

JD
AS
BJ
MK

Accessibility Notes

Best practices for accessible avatars.

Alt text: Always provide descriptive alt text for AvatarImage that identifies the person or entity.

Fallback content: Use meaningful initials or icons that help identify the user when images fail.

Non-interactive: Avatars are purely presentational. If clickable, wrap in a button with proper ARIA label.

Status indicators: If using status dots, consider adding aria-label to convey state to screen readers.

API Reference

Avatar

Size

Type: AvatarSize | Default: AvatarSize.Default

Controls the dimensions of the avatar. Options: Small (32px), Default (40px), Large (48px), ExtraLarge (64px).

Class

Type: string?

Additional CSS classes for the avatar container.

AvatarImage

Source

Type: string?

URL of the image to display. If loading fails, AvatarFallback will be shown.

Alt

Type: string?

Alternative text for the image (required for accessibility).

Class

Type: string?

Additional CSS classes for the image element.

AvatarFallback

Class

Type: string?

Additional CSS classes for the fallback container. Useful for custom background colors.

An unhandled error has occurred. Reload 🗙