Avatar

Sizes

The image sits on top of the initials. If the image has not loaded or is missing, the initials show instead.

Emma WilsonEW Emma WilsonEW Emma WilsonEW

Initials when there is no image

LN LN LN

A logo with a transparent background sits on white, in light and dark

Avatar images always have a white background, so dark logos stay readable in dark mode.

Acme Acme Acme

Circle

Use it for people, such as customers or staff. The rounded square is the default, for products and logos.

Olivia BrownOB Olivia BrownOB Olivia BrownOB

Group

Overlapping avatars with a ring in the background colour. End with the remaining count in data-count

Emma WilsonEW Olivia BrownOB James CarterJC +4

A count on the corner, such as the quantity of an order line

If a product has no image, use an icon instead of initials.

Watch1 Headphones12 3

A status dot on the corner, such as a product's availability

The dot is only colour, so give it role="img" and an aria-label that names the status.

Mug Watch Headphones

Attributes

Attribute / element Values Description
.avatar span Rounded avatar frame. Initials are grey.
img child Photo or logo, on top of the initials, always on white. Set alt to the name.
span child Initials or an icon, shown when there is no image.
data-size sm 24px · none (default) 32px · lg 40px Size.
data-variant none (default) rounded · circle Circle, for people.
span[data-count] number Inside .avatar: a count on the top-right corner, such as a quantity.
span[data-status] ok · warning · danger · info · empty (default) grey Status dot on the bottom-right corner. Needs role="img" + aria-label
.avatar-group div Overlapping avatars, separated by a ring in the background colour.
.avatar-group > [data-count] text, e.g. +4 Remaining count at the end of the group.