Avatar
An avatar is a visual representation of a user or entity.Installation
| Install | yarn add @atlaskit/avatar |
|---|---|
| Source | Bitbucket.org, (opens new window) |
| npm | @atlaskit/avatar, (opens new window) |
| Bundle | unpkg.com, (opens new window) |
Props
| Description | Analytics context meta data. |
|---|---|
| Type | { [x: string]: any; } |
| Description | Indicates the shape of the avatar. Most avatars are circular, but square avatars can be used for 'container' objects. |
|---|---|
| Type | "circle" | "square" | "hexagon" |
| Description | Identifies the popup element that the trigger controls.
Should match the |
|---|---|
| Type | string |
| Description | Announces to assistive technology whether the popup is currently open or closed. |
|---|---|
| Type | boolean |
| Description | Informs assistive technology that this element triggers a popup. |
|---|---|
| Type | boolean | "menu" | "listbox" | "tree" | "grid" | "dialog" |
| Description | Replace the wrapping element. This accepts the name of a html tag which will be used to wrap the element. |
|---|---|
| Type | keyof JSX.IntrinsicElements | React.ComponentType<React.AllHTMLAttributes<HTMLElement>> |
| Description | Used to override the default border color around the avatar body. Accepts any color argument that the border-color CSS property accepts. |
|---|---|
| Type | string |
| Description | Supply a custom avatar component instead of the default. |
|---|---|
| Type | string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | React.ReactPortal |
| Description | Provides a url for avatars being used as a link. |
|---|---|
| Type | string |
| Description | Defines the loading behaviour of the avatar image. Default value is eager. |
|---|---|
| Type | "lazy" | "eager" |
| Description | Change the style to indicate the avatar is disabled. |
|---|---|
| Type | boolean |
| 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)". |
|---|---|
| Type | string |
| Description | Provides alt text for the avatar image. |
|---|---|
| Type | string |
| Description | Handler to be called on click. |
|---|---|
| Type | (event: MouseEvent<Element, globalThis.MouseEvent>, analyticsEvent?: UIAnalyticsEvent) => void |
| 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%. |
|---|---|
| Type | Presence | Omit<ReactNode, string> | (string & {}) |
| Description | Allows getting a ref to the component instance.
Once the component unmounts, React will set @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs} |
|---|---|
| Type | string | React.Ref<HTMLElement> |
| Description | No description. |
|---|---|
| Type | "small" | "xxsmall" | "UNSAFE_xsmall" | "medium" | "large" | "xlarge" | "xxlarge" |
| Description | A url to load an image from (this can also be a base64 encoded image). |
|---|---|
| Type | string |
| Description | The index of where this avatar is in the group |
|---|---|
| Type | number |
| Description | Indicates contextual information by showing a small icon on the avatar. Refer to status values on the Status component. |
|---|---|
| Type | Omit<ReactNode, string> | (string & {}) | Status |
| Description | Assign specific tabIndex order to the underlying node. |
|---|---|
| Type | number |
| Description | Pass target down to the anchor, if href is provided. |
|---|---|
| Type | "_blank" | "_self" | "_top" | "_parent" |
| Description | A |
|---|---|
| Type | string |
| Description | Selects an experimental taller hexagon geometry for 16px, 24px, 32px, 40px, 96px, and 128px avatars. The 20px size retains the legacy geometry. |
|---|---|
| Type | boolean |