Introducing PrimeReact v11-alpha 🎉Discover Now
styledMisc

Avatar

Avatar represents people using icons, labels and images.

A
Amy ElsnerLondon to MiamiLHR → MIA
14:30Gate B12
OL
Onyama LimbaParis to IstanbulCDG → IST
09:15Gate A4
preview

Usage#

import { Avatar } from '@primereact/ui/avatar';
import { AvatarGroup } from '@primereact/ui/avatargroup';
<AvatarGroup>
    <Avatar.Root>
        <Avatar.Image />
        <Avatar.Fallback />
    </Avatar.Root>
</AvatarGroup>

Examples#

Basic#

Displays a user representation using an image, icon, or label initials.

A
basic-demo

Fallback#

The Avatar.Fallback component displays a label or an icon when an image fails to load or when an image is not preferred.

J
CC
fallback-demo

Image#

The Avatar.Image component displays an image as an Avatar.

A
A
O
image-demo

Badge#

Badge component can be used to display a badge on an Avatar.

O
2
W
badge-demo

Shape#

Use the shape property to change the appearance.

W
W
shape-demo

Sizes#

Use the size property to change the size of an avatar.

AB
AB
AB
AB
AB
AB
size-demo

AvatarGroup#

Grouping is available by wrapping multiple Avatar components inside an AvatarGroup component.

A
A
O
I
X
+2
group-demo

API#

Sub-Components#

See Primitive API for AvatarRoot, AvatarImage, AvatarFallback, and AvatarGroup component documentation.

Hooks#

See Headless API for useAvatar and useAvatarGroup hook documentation.

Accessibility#

See Avatar Primitive for WAI-ARIA compliance details and keyboard support.