Avatar

An avatar is a visual representation of a user or entity.

Installation

Package installation information
Installyarn add @atlaskit/avatar
SourceBitbucket.org, (opens new window)
npm@atlaskit/avatar, (opens new window)
Bundleunpkg.com, (opens new window)

Props

analyticsContext

Description

Analytics context meta data.

Type{ [x: string]: any; }

appearance

Description

Indicates the shape of the avatar. Most avatars are circular, but square avatars can be used for 'container' objects.

Type"circle" | "square" | "hexagon"

aria-controls

Description

Identifies the popup element that the trigger controls. Should match the id of the popup content for screen readers to understand the relationship.

Typestring

aria-expanded

Description

Announces to assistive technology whether the popup is currently open or closed.

Typeboolean

aria-haspopup

Description

Informs assistive technology that this element triggers a popup.

Typeboolean | "menu" | "listbox" | "tree" | "grid" | "dialog"

as

Description

Replace the wrapping element. This accepts the name of a html tag which will be used to wrap the element.

Typekeyof JSX.IntrinsicElements | React.ComponentType<React.AllHTMLAttributes<HTMLElement>>

borderColor

Description

Used to override the default border color around the avatar body. Accepts any color argument that the border-color CSS property accepts.

Typestring

children

Description

Supply a custom avatar component instead of the default.

Typestring | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.ReactPortal

href

Description

Provides a url for avatars being used as a link.

Typestring

imgLoading

Description

Defines the loading behaviour of the avatar image. Default value is eager.

Type"lazy" | "eager"

isDisabled

Description

Change the style to indicate the avatar is disabled.

Typeboolean

label

Description

Used to provide custom content to screen readers. Status or presence is not added to the label by default if it passed as nodes. If status or presence is passed as a string, the default content format is "John Smith (online)".

Typestring

name

Description

Provides alt text for the avatar image.

Typestring

onClick

Description

Handler to be called on click.

Type(event: MouseEvent<Element, globalThis.MouseEvent>, analyticsEvent?: UIAnalyticsEvent) => void

presence

Description

Indicates a user's online status by showing a small icon on the avatar. Refer to presence values on the presence component. Alternatively accepts any React element. For best results, it is recommended to use square content with height and width of 100%.

TypePresence | Omit<ReactNode, string> | (string & {})

ref

Description

Allows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref).

@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}

Typestring | React.Ref<HTMLElement>

size

Description
No description.
Type"small" | "xxsmall" | "UNSAFE_xsmall" | "medium" | "large" | "xlarge" | "xxlarge"

src

Description

A url to load an image from (this can also be a base64 encoded image).

Typestring

stackIndex

Description

The index of where this avatar is in the group stack.

Typenumber

status

Description

Indicates contextual information by showing a small icon on the avatar. Refer to status values on the Status component.

TypeOmit<ReactNode, string> | (string & {}) | Status

tabIndex

Description

Assign specific tabIndex order to the underlying node.

Typenumber

target

Description

Pass target down to the anchor, if href is provided.

Type"_blank" | "_self" | "_top" | "_parent"

testId

Description

A testId prop is provided for specified elements, which is a unique string that appears as a data attribute data-testid in the rendered code, serving as a hook for automated tests.

Typestring

UNSAFE_isUpdatedGeometry

Description

Selects an experimental taller hexagon geometry for 16px, 24px, 32px, 40px, 96px, and 128px avatars. The 20px size retains the legacy geometry.

Typeboolean
Was this page helpful?
We use this feedback to improve our documentation.
© 2026 AtlassianTrademark, (opens new window)Privacy, (opens new window)License