Mahmoud Ilyan

Avatar

Component

About

A user avatar that shows a photo with an initials/icon fallback, plus optional presence status dots, notification badges, and a stacked group layout for showing multiple users.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Avatar to your project and fits it to your theme.

Code

How Avatar is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import {
  Avatar,
  AvatarImage,
  AvatarFallback,
  AvatarStack,
} from "@/components/ui/avatar";

export default function AvatarStackDemo() {
  return (
    <AvatarStack max={3} size="md">
      <Avatar>
        <AvatarImage
          src="https://cdn.21st.dev/assets/mirror/d7/d780e51ca6efa0e7686e50f0f266a1660fc561385f3eaa329b0560c69bfee582.svg"
          alt="User 1"
        />
        <AvatarFallback>U1</AvatarFallback>
      </Avatar>
      <Avatar>
        <AvatarFallback>U2</AvatarFallback>
      </Avatar>
      <Avatar>
        <AvatarFallback>U3</AvatarFallback>
      </Avatar>
      <Avatar>
        <AvatarFallback>U4</AvatarFallback>
      </Avatar>
      <Avatar>
        <AvatarFallback>U5</AvatarFallback>
      </Avatar>
    </AvatarStack>
  );
}

Dependencies

More by Mahmoud Ilyan

View all
  • Radio Card

    Radio Card

  • Switch

    Switch

  • Segmented Control

    Segmented Control

  • Checkbox

    Checkbox