Surface override; defaults to the nearest provider.
aria-label
string
—
Accessible name for the avatar landmark. Without one, role=group is dropped.
aria-labelledby
string
—
Id of the element that names the group, in place of aria-label.
children* (required)
React.ReactNode
—
The avatars.
Also takes the native attributes and event handlers of <div> (HTMLAttributes<HTMLDivElement>).
ref points to <div>.
Accessibility
WCAG target: 2.1 AA
group
Provide aria-label or aria-labelledby summarizing the count (e.g. "5 team members"); without one, role=group is dropped so the cluster is treated as presentational. The "+N" overflow tile hides its visible "+N" from assistive tech and announces "N more users" through screen-reader-only text.
Usage
import { PixelAvatarGroup, PixelAvatar } from '@pxlkit/ui-kit';
export function Default() {
return (
<PixelAvatarGroup aria-label="3 team members">
<PixelAvatar name="Joangel De La Rosa" />
<PixelAvatar name="Ana Lopez" />
<PixelAvatar name="Carlos Diaz" />
</PixelAvatarGroup>
);
}
Examples
Default
import { PixelAvatarGroup, PixelAvatar } from '@pxlkit/ui-kit';
export function Default() {
return (
<PixelAvatarGroup aria-label="3 team members">
<PixelAvatar name="Joangel De La Rosa" />
<PixelAvatar name="Ana Lopez" />
<PixelAvatar name="Carlos Diaz" />
</PixelAvatarGroup>
);
}
With Overflow
import { PixelAvatarGroup, PixelAvatar } from '@pxlkit/ui-kit';
export function WithOverflow() {
return (
<PixelAvatarGroup aria-label="6 team members" max={4}>
<PixelAvatar name="Joangel De La Rosa" />
<PixelAvatar name="Ana Lopez" />
<PixelAvatar name="Carlos Diaz" />
<PixelAvatar name="Diana Perez" />
<PixelAvatar name="Eduardo Ruiz" />
<PixelAvatar name="Fabiola Garcia" />
</PixelAvatarGroup>
);
}