mayurrawte

Avatar

Component

About

A circular user avatar image that automatically falls back to initials text when the image URL is missing or fails to load.

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

export default function Example() {
  return (
    <div className="flex items-center gap-3">
      <Avatar
        src="https://cdn.21st.dev/assets/localized/61e53ab1d79919613c6b48ddc75268520357036719ab400df75c5553dbae639c.png"
        alt="Anthropic"
        fallback="AN"
      />
      <Avatar fallback="MB" />
    </div>
  );
}

Dependencies

More by mayurrawte

View all
  • Feedback Buttons

    Feedback Buttons

    4
  • Streaming Text

    Streaming Text

    4
  • MCP Scope Inspector

    MCP Scope Inspector

    2
  • Tooltip

    Tooltip

    2
  • Accordion

    Accordion

    2
  • Skeleton

    Skeleton

    2
  • Select Dropdown

    Select Dropdown

    1
  • Loader

    Loader

    1