GitHub Stars

Avatar

An image element with a fallback for representing the user.

@silveltm
SV
@silveltm
SV
FD
@silveltm
SV
@silveltm
SV
@silveltm
SV

Installation

npx shadcn@latest add @fulldev/avatar

Usage

import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
<Avatar>
  <AvatarImage src="/avatar.jpg" alt="Team member" />
  <AvatarFallback>TM</AvatarFallback>
</Avatar>

Composition

Use the following composition to build an Avatar:

Avatar
├── AvatarImage
├── AvatarFallback
└── AvatarBadge

Use the following composition to build an AvatarGroup:

AvatarGroup
├── Avatar
│   ├── AvatarImage
│   ├── AvatarFallback
│   └── AvatarBadge
├── Avatar
│   ├── AvatarImage
│   ├── AvatarFallback
│   └── AvatarBadge
└── AvatarGroupCount

Examples

Fallback

Use AvatarFallback when an image is unavailable or intentionally omitted.

FD

Group

Use AvatarGroup when you need overlapping participant or collaborator lists.

Sil Veltman
SV
Teammate
TM
+3

Notes

  • Always include AvatarFallback so initials or placeholder content remain visible when the image fails to load.
  • Use size variants on Avatar instead of custom width and height classes when possible.

API Reference

See the GitHub source code for more information on props.