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

export default function AvatarSizesDemo() {
  return (
    <div className="flex items-end gap-4">
      <Avatar size="xs">
        <AvatarFallback>XS</AvatarFallback>
      </Avatar>
      <Avatar size="sm">
        <AvatarFallback>SM</AvatarFallback>
      </Avatar>
      <Avatar size="md">
        <AvatarFallback>MD</AvatarFallback>
      </Avatar>
      <Avatar size="lg">
        <AvatarFallback>LG</AvatarFallback>
      </Avatar>
      <Avatar size="xl">
        <AvatarFallback>XL</AvatarFallback>
      </Avatar>
    </div>
  );
}

Dependencies

More by Mahmoud Ilyan

View all
  • Radio Card

    Radio Card

  • Switch

    Switch

  • Segmented Control

    Segmented Control

  • Checkbox

    Checkbox