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 } from "@/components/ui/avatar";

export default function AvatarWithImageDemo() {
  return (
    <Avatar size="lg">
      <AvatarImage
        src="https://cdn.21st.dev/assets/mirror/3d/3d417eaffb3b753ba46abef2d11951958fddd382ef020d475f06088937806c32.svg"
        alt="User Avatar"
      />
      <AvatarFallback>CN</AvatarFallback>
    </Avatar>
  );
}

Dependencies

More by Mahmoud Ilyan

View all
  • Radio Card

    Radio Card

  • Switch

    Switch

  • Segmented Control

    Segmented Control

  • Checkbox

    Checkbox