Avatar GroupLoading saved progress…

Avatar Group

An avatar group shows a limited row of people and summarizes everyone who does not fit with a +N badge. Build the React version by deriving the visible slice and hidden count from one user list and one limit. The supplied preview is intentionally incomplete: its fixed values omit one visible collaborator and miscount the overflow.

Signature

Implement the derivations inside the App component in App.tsx. Keep the provided users, max, palette, markup, and styles; replace the preview-only visible and overflow values.

Examples

  • With six users and max = 4, render AL, AT, GH, and LT, followed by +2.
  • With three users and max = 4, render all three avatars and no overflow badge.
  • If max = 0, render no avatars and one +6 badge.

Notes

  • Derive during render. Use users.slice(0, max) and users.length - max; no React state is needed.
  • Preserve order. The first user remains the first visible avatar.
  • Render a positive count only. Do not show a badge when everyone fits.
  • Assume a valid limit. max is a non-negative integer.
  • Keep the accessible names. Every avatar names its person, while the group and overflow badge describe their purpose.
  • Leave presentation alone. The overlap, colours, dimensions, and dark canvas already live in styles.css.
WE’RE LISTENING

Help make UIReady better

Found a bug or have an idea? Tell us about it.

Up to 3 files · 5 MiB each · JPG, PNG, WebP, MP4, WebM, MP3, M4A or WAV