Components/Media
Interactive docs page: https://wix-pages.com/design-system-documentation/#/component/avatar
Avatar visually represents a user or an organization either as an image, text (name initials) or a placeholder image.
<Image/> instead.<AvatarGroup/> instead.<Image/> instead.Control the form of the avatar with a shape prop. It supports 2 shapes:
 - `circle` (default) - use it to represent a user.
 - `square` - use it to represent an entity such as a company or organization.
Component has 3 states:
 - Loads image when image URL is provided.
 - Falls back to the placeholder when provided image URL is broken or not given.
 - Display initials when image URL is broken or not given, but avatar name is defined.
Adjust the avatar size using size prop. It supports 8 sizes:
 - `size90`
 - `size72`
 - `size60`
 - `size48` (default)
 - `size36`
 - `size30`
 - `size24`
 - `size18`
Control avatar color with color prop. It supports 6 colors:
A1 blueA2 arctic blueA3 purpleA4 greenA5 magentaA6 yellowUse the presence prop to indicate the status of a user. It supports 3 statuses:
 - `online` - indicates that user is online.
 - `offline` - indicates that user is not available.
 - `busy` - indicates that user is online, but is busy, so might not be accessible.
Display a placeholder when component has no image and no name. When required, override default placeholders to any custom elements by passing required content to `placeholder` prop.
Render any indicator via `customIndication` prop. It accepts any component or a set of them within a restricted dimensions:
 - 30x30px container for avatar in `size90`, `size72`.
 - 24x24px container for avatar in `size60`, `size48`.
Smaller avatar sizes cannot have custom indicators.
Render related action such as image upload as an icon button with `indication` prop. This prop applies for 4 largest avatar sizes only: size90, size72, size60 and size48.
Reveal action button on avatar hover only with `showIndicationOnHover` prop.
Render related action such as image upload as an icon button with `indication` prop. This prop applies for 4 largest avatar sizes only: size90, size72, size60 and size48.
Use <Avatar/> as a first data column in a table to visually represent your customers.
Use <Avatar/> as a prefix item to build user selections.
Use an `indication` prop to display a button allowing users to manually upload a photo to avatar
| Name | Type | Default | Description |
|---|---|---|---|
ariaLabel | string | — | Defines a string that labels the current element in case where text label isn't visible on the screen. |
color | "A1" | "A2" | "A3" | "A4" | "A5" | "A6" | "A7" | — | Controls the background color of the avatar. If not provided, color is determined by the provided text or name so that each name receives a different color. |
customIndication | ReactNode | — | Accept any content to render as a custom indication item. This indication element won't be wrapped by an IconButton. It could be rendered in other shapes (such as square). |
dataHook | string | — | Applies a data-hook HTML attribute that can be used in the tests. |
imgProps | ImgHTMLAttributes<HTMLImageElement> | — | Accept all common <img> tag properties. |
indication | ReactNode | — | Accept any content to render as an indication item. |
loading | boolean | — | Shows a loader on top of an avatar. |
name | string | — | Defines a name of the avatar user. Text initials are generated from the name. The name value is used as the default value for HTML title and aria-label attributes. And also as default value for the image's alt attribute if imgProps is provided. |
onClick | () => void | — | Defines a click event handler. When defined, component will be clickable and will have a pointer cursor on hover. |
onIndicationClick | () => void | — | Defines a callback function which is called every time indication element is clicked. |
placeholder | ReactNode | — | Accept any content to render as a content placeholder. This placeholder is displayed if no text, name or imgProps are provided. By default use a generic avatar user icon. |
presence | "online" | "offline" | "busy" | — | Sets the presence status of an avatar. |
shape | "circle" | "square" | 'circle' | Controls the shape of the image. |
showIndicationOnHover | boolean | false | Shows indication element on hover. |
size | "size90" | "size72" | "size60" | "size48" | "size36" | "size30" | "size24" | "size18" | 'size48' | Controls the size of an avatar. |
text | string | — | Defines a text to render as a content instead of a given name. |
title | string | — | Defines a standard HTML title attribute value. Applies it to the root element. |
Import the driver matching your test environment:
| Method | Description |
|---|---|
click | Clicks on the Avatar element |
getContentType | Gets the content type |
getTextContent | Gets the text content |
isImageLoaded | Checks whether the image is loaded |
hover | Hovers the component |
indicationExists | Checks whether the Avatar indication exists |
clickIndication | Clicks the Avatar indication |
customIndicationExists | Checks whether the Avatar custom indication exists |
clickCustomIndication | Clicks the Avatar custom indication |
isLoading | Checks whether the Avatar is loading |
exists | Checks whether the component found with the given data hook. |
element | Gets the component root element. |
base | Returns UniDriver for the base element. |
Last updated: 22 October 2026