About
An avatar component with image and text fallback for displaying user profile pictures, built on Base UI.
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 AvatarDemo() {
return (
<div className="flex min-h-64 w-full items-center justify-center gap-6 bg-background p-8">
<Avatar className="size-12">
<AvatarImage
alt="Luke Tracy"
src="https://cdn.21st.dev/assets/mirror/ad/adfa33eea333b2ca8227b64fc1555b8993a79f63fed7941677169821a9fefdba.jpg"
/>
<AvatarFallback>LT</AvatarFallback>
</Avatar>
<Avatar className="size-12">
<AvatarImage src="/broken-image.png" alt="User avatar" />
<AvatarFallback>JD</AvatarFallback>
</Avatar>
</div>
);
}







