About
A user or entity profile picture that falls back to initials or an icon, with optional size, shape, color tint, status badge, and stacked group variants.
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,
AvatarBadge,
AvatarFallback,
AvatarImage,
} from "@/components/ui/avatar";
import { User } from "lucide-react";
export default function AvatarDemo() {
return (
<div className="flex w-full flex-wrap items-center justify-center gap-6 p-10">
<Avatar>
<AvatarFallback>
<User />
</AvatarFallback>
</Avatar>
<Avatar size="xl" shape="square">
<AvatarFallback>
<User />
</AvatarFallback>
<AvatarBadge className="bg-success" />
</Avatar>
<Avatar size="xl" shape="square" color="indigo">
<AvatarFallback>AV</AvatarFallback>
<AvatarBadge className="bg-success" />
</Avatar>
<Avatar size="xl" shape="square">
<AvatarImage src="https://cdn.21st.dev/assets/mirror/c9/c9b920be26276cd1a44f4fb4e0e395e8fb706d8ae4a0e75f77a27bae28e82f73.jpg" alt="Alex Lee" />
<AvatarFallback>AL</AvatarFallback>
<AvatarBadge className="bg-success" />
</Avatar>
<Avatar variant="primary">
<AvatarFallback>JS</AvatarFallback>
</Avatar>
</div>
);
}


