shadcn

Avatar

Component 66

About

An image element with a fallback for representing the user.

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

function Basic() {
  return (
    <div className="flex -space-x-3 *:ring *:ring-background">
      <Avatar>
        <AvatarImage src="https://cdn.21st.dev/assets/localized/7fa55179b43294add3e70c73debc1c3f61294ca434a6335e79a24ad29d1c114d.webp" />
      </Avatar>
      <Avatar>
        <AvatarImage src="https://cdn.21st.dev/assets/localized/5a3b59db75f926925800311b50b6e091f955d5a357d67cbd34c52dca43b9c0c7.webp" />
      </Avatar>
      <Avatar>
        <AvatarImage src="https://cdn.21st.dev/assets/localized/2ec4769bc69ba81b258a9e8ae32be57e8b7c9e6da68a709533b168f43324f620.webp" />
      </Avatar>
    </div>
  );
}

export { Basic };

export default Basic;

Dependencies

More by shadcn

View all
  • Navigation menu

    Navigation menu

    781
  • Calendar with time pressets

    Calendar with time pressets

    511
  • Sidebar

    Sidebar

    344
  • Sonner

    Sonner

    236
  • Chart

    Chart

    220
  • Icons

    Icons

    189
  • Dropdown Menu

    Dropdown Menu

    153
  • Calendar with event slots

    Calendar with event slots

    119