Component guideEditable source

Avatar

A user or entity image with a fallback, sizes, and optional group styling.

Original component docs
On this page6 sectionsBack to top

Use Avatar to represent a person or entity in a compact space. Keep a fallback for slow or failed image requests. It does not identify a user, load account data, or implement an account menu.

Live preview
Loading preview...

#Installation

Complete the base setup. For manual installation:

npx shadcn@latest add https://neobrutal-ui.andongmin.com/r/avatar.json

#Usage

import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar";

export default function MemberAvatar() {
  return (
    <div className="flex items-center gap-3">
      <Avatar>
        <AvatarImage src="/images/member.jpg" alt="" />
        <AvatarFallback aria-hidden="true">JD</AvatarFallback>
      </Avatar>
      <span>Jordan Davis</span>
    </div>
  );
}

Add your own image asset. This example keeps the name visible, so the image is decorative. An avatar used alone needs an accessible name for the person or action it represents.

#API reference

Prop / partPurposeDefault
Avatar.sizesm, default, or lgdefault
AvatarImage.src / altImage address and alternative text—
AvatarFallbackInitials or non-image content—
AvatarFallback.delayFallback delay in millisecondsPrimitive default
AvatarBadgeStatus marker—
AvatarGroup / AvatarGroupCountGroup and remaining count—

#Accessibility

Avoid announcing the same name twice when it is already adjacent to the image. A status badge needs text or an accessible label; color alone is insufficient. Put an interactive avatar inside a real button or link with an explicit name, rather than adding click handling to a generic container.

#Examples

#Fallback

Loading preview...