About
A user profile image with a text fallback, plus badge, grouping and size variants for stacking multiple avatars together.
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, AvatarImage } from "@/components/ui/avatar";
export default function AvatarSizeExample() {
return (
<div
dir="rtl"
className="flex flex-wrap items-center justify-center gap-2 grayscale"
>
<Avatar size="sm">
<AvatarImage
src="https://cdn.21st.dev/assets/localized/513d06f542692036ff0bb17938f04b3efd60567ba2cae08049469d21f18e0524.jpg"
alt="@shadcn"
/>
<AvatarFallback>شک</AvatarFallback>
</Avatar>
<Avatar>
<AvatarImage
src="https://cdn.21st.dev/assets/localized/513d06f542692036ff0bb17938f04b3efd60567ba2cae08049469d21f18e0524.jpg"
alt="@shadcn"
/>
<AvatarFallback>شک</AvatarFallback>
</Avatar>
<Avatar size="lg">
<AvatarImage
src="https://cdn.21st.dev/assets/localized/513d06f542692036ff0bb17938f04b3efd60567ba2cae08049469d21f18e0524.jpg"
alt="@shadcn"
/>
<AvatarFallback>شک</AvatarFallback>
</Avatar>
</div>
);
}







