Web · Components
Avatar
Profile photo.
7 exports
Live example
Preview

Code
Events
- Events appear here when you interact with the preview.
AvatarGroup: the rest as +N; names appear on hover
AYMK+2Import
Profile photo. Shows the initials of name until the photo loads or if it fails, so the layout doesn't shift and no broken image appears.
Examples
Overlapping avatar group (e.g. the people on a project). On hover the person's name shows as a tooltip; the "+3" summary's tooltip lists the hidden people's names.
Examples
AvatarSize
typeAvatar size: xs 24 px, sm 32 px, md 40 px, lg 48 px, xl 64 px.
AvatarStatus
typeStatus dot at the avatar's corner.
AvatarProps
interfaceProps of the Avatar component.
Extends: Omit<ComponentProps<"span">, "children">
| Name | Type | Default | Description |
|---|---|---|---|
src? | string | null | Photo URL. If it fails to load, initials or an icon appear instead. | |
name? | string | The person's name. Becomes the photo's screen reader name, and its initials are shown when there is no photo. | |
icon? | IconProp | Icon shown when there is no photo or name: a name or an element. | |
fallback? | ReactNode | Custom content shown instead of initials when there is no photo. | |
size? | AvatarSize | "md" | |
shape? | "circle" | "square" | "circle" | |
status? | AvatarStatus | Status dot at the bottom right corner. | |
effect? | EffectProp | Effect or effects (e.g. "ripple", ["lift", "beam"]). Defaults to UIProvider appearance.defaults.avatar.effect. See BuiltinEffect. | |
tooltip? | TooltipProp | Tooltip shown on hover, focus or long press (e.g. tooltip={name}). When it is text other than the name, the avatar also becomes keyboard focusable. See TooltipProp. |
AvatarGroupItem
interfaceA person inside an AvatarGroup.
| Name | Type | Description |
|---|---|---|
src? | string | null | Photo URL. |
name | string | The person's name. |
tooltip? | TooltipProp | Tooltip. Shows the name when omitted; turned off with false. |
AvatarGroupProps
interfaceProps of the AvatarGroup component.
Extends: Omit<ComponentProps<"div">, "children">
| Name | Type | Default | Description |
|---|---|---|---|
items | readonly AvatarGroupItem[] | People to show. | |
max? | number | Maximum number of avatars to show; the rest is summarized as "+3". | |
size? | AvatarSize | "md" |