Skip to content
GitHub ↗

Social / React + CSS

Avatar stack

Overlapping profile chips fan out and lift on hover or focus.

Live preview

Good work is a team sport.

4 people, one shared direction.

Make it yours

Use for a small team or group of collaborators. Replace the illustrative people with real users and connect onSelect to a profile view when appropriate. For large groups, show a count instead of crowding the row.

  1. Use a React project with CSS Modules support, such as Next.js or Vite.
  2. Save the JSX as AvatarStack.jsx and the CSS as AvatarStack.module.css in the same folder.
  3. Import AvatarStack and connect its props to your application. Controlled components need parent state and change handlers.

No third-party component or animation package is required. Use the theme controls to adjust accent, corners, spacing, and type. Copy the Theme CSS into your stylesheet and wrap your components in <div className="tdp-components">. The theme applies to every component inside that wrapper. TDP defaults work without a theme file.

Props

PropTypeUse
membersarrayUnique name, initials, color, and role for each member.
onSelectfunctionReceives the selected member.

Accessibility & behavior

Every profile is a named button. Hover names also appear on focus, and selection is announced. Initials are decorative because the button already has the full name.

Visible focus styles and reduced-motion support are included. Check labels, contrast, keyboard behavior, and screen-reader output again after adapting the component to your product.

Keep building