WFP logoDesign System

An image element with a fallback for representing the user.

FGGKCS

Installation

pnpm dlx shadcn@latest add https://dev.designsystem.wfp.org/r/avatar.json

Usage

import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar";
<Avatar>
  <AvatarImage src="…" alt="@johndoe" />
  <AvatarFallback>JD</AvatarFallback>
</Avatar>

Examples

Fallback

Use AvatarFallback to display user initials or an icon when no image is available.

FGGK

Size

Use the size prop to change the size of the avatar.

FGFGFG

Badge

Use the AvatarBadge component to add a badge indicator to the avatar. The badge is positioned at the bottom right.

FGGKCS

Avatar Group

Use the AvatarGroup component to add a group of avatars.

Use <AvatarGroupCount> to add a count to the group.

FGGKCS
+5

API reference

Avatar

The Avatar component is the root component that wraps the avatar image and fallback.

PropTypeDefault
size"sm" | "default" | "lg""default"

AvatarImage

The AvatarImage component displays the avatar image. It accepts all Radix UI Avatar Image props.

AvatarFallback

The AvatarFallback component displays a fallback when the image fails to load. It accepts all Radix UI Avatar Fallback props.

AvatarBadge

The AvatarBadge component displays a badge indicator on the avatar, typically positioned at the bottom right.

AvatarGroup

The AvatarGroup component displays a group of avatars with overlapping styling.

AvatarGroupCount

The AvatarGroupCount component displays a count indicator in an avatar group, typically showing the number of additional avatars.

For more information about Radix UI Avatar props, see the Radix UI Avatar documentation.

Changelog

  • 21 July 2026: refined fallback styling: semibold font, auto-sized icons
  • 3 March 2026: adjusted the background colour

On this page