Skip to content
Stylhero 0.8.0
Components

Core

Layout and type

Inputs

Overlays

Navigation

Data display

Charts

Transitions and utilities

Page pieces (landing pages, portfolios, docs)

Icons

Components / Core

AvatarGroup

Overlapping stack of avatars with a "+N" for the rest.

import { AvatarGroup } from "@stylhero/ui";

Example

Code
import { Avatar, AvatarGroup } from "@stylhero/ui";

function AvatarGroupExample() {
  return (
    <AvatarGroup max={3}>
      {["Ana López", "Ben Ortiz", "Cy Park", "Dee Moss", "Eli Fox"].map((n) => <Avatar key={n} name={n} />)}
    </AvatarGroup>
  );
}

Props

PropTypeDefaultDescription
children required ReactNode[] - Avatar elements.
max number 4 Show at most this many, then "+N".
size AvatarProps["size"] "md"

Also takes every <div> attribute (id, style, data-*, aria-*, event handlers…), passed to that element.

Accessibility

  • A role="group"; the "+3" overflow is labelled with how many more there are.

Generated from src/components/Avatar.tsx. Something wrong or missing? Open an issue.