Avatar group
An avatar group displays a number of avatars grouped together in a stack or grid.Neutral selected states
When the platform-dst-tokens-finesse feature flag is enabled, this component uses the new neutral treatment for selected states.
Motion in Early Access
Motion updates for this component are in Early Access and available behind the platform-dst-motion-uplift feature flag.
Installation
| Install | yarn add @atlaskit/avatar-group |
|---|---|
| Source | Bitbucket.org, (opens new window) |
| npm | @atlaskit/avatar-group, (opens new window) |
| Bundle | unpkg.com, (opens new window) |
Props
| Description | Indicates the layout of the avatar group. Avatars will either be overlapped in a stack, or laid out in an even grid formation. Defaults to "stack". |
|---|---|
| Default | "stack" |
| Type | "grid" | "stack" |
| Description | Component used to render each avatar. |
|---|---|
| Default | Avatar |
| Type | AvatarComponent | React.ElementType<AvatarProps, keyof React.JSX.IntrinsicElements> |
| Description | Typically the background color that the avatar is presented on. Accepts any color argument that the CSS border-color property accepts. |
|---|---|
| Type | string |
| Description | Element the overflow popup should be attached to. Defaults to "viewport". |
|---|---|
| Type | "viewport" | "window" | "scrollParent" |
| Description | An array of avatar prop data, that are spread onto each For further usage information on AvatarPropTypes, the supported props for |
|---|---|
| Type | (AvatarPropTypes & { name: string; key?: string | number; })[] |
| Description | Disables tooltips. |
|---|---|
| Type | boolean |
| Description | Text to be used as aria-label for the list of avatars.
Screen reader announcement with default label, which is The label should describe the
When there are several AvatarGroups on the page you should use a unique label to let users distinguish different lists. |
|---|---|
| Default | "avatar group" |
| Type | string |
| Description | The maximum number of avatars allowed in the list. Defaults to 5 when displayed as a stack, and 11 when displayed as a grid. |
|---|---|
| Type | number |
| Description | Text to be used as aria-label for the more indicator.
If provided, this will be used exactly as-is for the aria-label.
If not provided, but an |
|---|---|
| Type | string |
| Description | Handle the click event on the avatar item. Note that if an onClick prop is provided as part of avatar data, it will take precedence over onAvatarClick. |
|---|---|
| Type | (event: React.MouseEvent<Element, MouseEvent>, analyticsEvent: AnalyticsEvent, index: number) => void |
| Description | Take control of the click event on the more indicator. This will cancel the default dropdown behavior. |
|---|---|
| Type | (event: React.MouseEvent<Element, MouseEvent>) => void |
| Description | Custom overrides for the composed components. |
|---|---|
| Type | AvatarGroupOverrides |
| Description | Determines whether the 'show more' popup has |
|---|---|
| Default | false |
| Type | boolean |
| Description | Provide additional props to the MoreButton. Example use cases: altering tab order by providing tabIndex; adding onClick behaviour without losing the default dropdown |
|---|---|
| Default | {} |
| Type | { defaultChecked?: boolean; defaultValue?: string | number | readonly string[]; suppressContentEditableWarning?: boolean; suppressHydrationWarning?: boolean; accessKey?: string; autoCapitalize?: (string & {}) | ... 5 more ... | "characters"; ... 257 more ...; onTransitionEndCapture?: React.TransitionEventHandler<...... |
| Description | Defines the size of the avatar. Defaults to "medium". Note: The "xxsmall" (16px), legacy "xsmall", and "UNSAFE_xsmall" (20px) sizes that exist on Avatar are not supported here because elements such as the more indicator cannot be displayed in an accessible manner at those sizes. |
|---|---|
| Default | "medium" |
| Type | "small" | "medium" | "large" | "xlarge" | "xxlarge" |
| Description | A
|
|---|---|
| Type | string |
| Description | Where the tooltip should appear relative to its target. Defaults to tooltip position "bottom". |
|---|---|
| Default | "bottom" |
| Type | "top" | "bottom" |