Avatar

Represent a person, a team or a thing with an image, initials or an icon, with an indicator on a corner or an edge, a ring and group stacking that hold at every size.

Basic

Give Avatar a src, an icon or text as children, and longer text like "User" scales down to fit the circle.

Variant

Set variant to filled, solid or outlined to choose how color is painted, with filled as the default once a color is set.

Colors

Set color to any color name, here every one the theme defines, and switch variant to compare the three treatments.

Shape

Set shape to square or squircle, a smooth superellipse corner, instead of the default circle.

Size

Set size to small, medium or large, or to a number of pixels for any other size.

Responsive size

Pass size an object of breakpoints to change the avatar's size with the screen width, from xs up to xxl.

Auto font size

Text in children scales down to fit the circle, so one, two or three letters all stay inside it.

Gap

Set gap to change the space between the text and the edge of the circle, where a larger gap makes the text smaller.

Image avatars

Pass src, and srcSet for sharper screens, to show a photo, with alt naming the person for screen readers.

Icon avatars

Pass icon any node, like an Icon from your pack, and color the avatar with color or a bg-* class.

Image fallback

When src fails to load, the avatar shows its children or icon instead, so pass the initials or icon you would show anyway.

Skeleton

Show Skeleton.Avatar at the same size and shape while data loads, so the row does not move when the avatar arrives.

Status

Show a state three ways at once: a colored ring, a corner icon through indicator, and a Tooltip that says it in words.

Grayscale

Add grayscale to className to desaturate an avatar until it is hovered, the usual way a directory marks someone as away.

Indicator

Pass indicator a node, like a childless Badge or an icon, to place it on the avatar's corner, on the edge of any shape.

Indicator position

Set indicatorPosition to a corner, or to top-center or bottom-center for the middle of an edge. start and end follow the text direction.

Badge

Put a childless Badge in indicator for a count, a dot, a capped count like 9+, an icon or a status dot.

Ring

Add a ring-* class with ring-offset-container to draw a ring outside the avatar, for a selected or error state.

Progress

Wrap an avatar in a circle Progress sized from the avatar's pixel size, for a completion ring that can change color with the value.

Story ring

Wrap the avatar in a gradient ring and paint its border border-container to make the gap, for unseen, seen, live, broadcasting and dashed stories.

Removable

Overlay a Button on each avatar that shows on hover and on focus, with an aria-label naming the person it removes.

Group

Wrap avatars in Avatar.Group to overlap them, and set max.count to fold the rest into a +2 chip that lists them on hover.

Group size and shape

Set size and shape on the group to apply them to every avatar inside it.

Group overlap

Set overlap to none, medium or large to change how far each face slides under the last, and add classes for a staggered or shadowed stack.

Group tooltips

Wrap each avatar in a Tooltip to show its name on hover, since a stacked group hides everyone's name.

Group in a pill

Set surface to put the group on a raised pill whose corners follow shape and whose avatar rings match it, with room for a label.

Expandable group

Set expandOnHover to spread the stack, or lift or color one face with classes. Tooltip.UniqueProvider slides one bubble between the faces.

In context

The component inside real screens, with the components it usually sits beside.

Team stack

A project card with the team as an overlapping stack, a Tooltip naming each face, a +3 chip for the rest and an Invite button.

Account menu

An account menu in an app bar, opened from a Button with the avatar prop so the picture gets a keyboard-reachable trigger.

People picker

A people picker that keeps its dropdown open while you tick several names, and shows the chosen people as a stack below it.

Social proof

A marketing strip with a small stack of faces beside a join count, with size set once on the group.

Comment thread

A discussion card where each comment has an avatar beside the author's name, a role tag and when it was posted.

Team directory

A team directory where each avatar carries a presence dot through indicator, matched by a status tag at the end of the row.

Story viewer

A story rail where each face opens a viewer with timed progress bars, and its ring turns gray once the story has been seen.

API Reference

Avatar
Avatar's props. Rows marked antuikit in the Version column are added by the kit.
Avatar.Group
Avatar.Group's props.