npx shadcn add https://hq-ui.vercel.app/r/avatar
A basic avatar component with an image and a fallback.

Use the AvatarBadge component to add a badge to the avatar. The badge is positioned at the bottom right of the avatar.

Use the className prop to add custom styles to the badge such as custom colors, sizes, etc.
<Avatar src="https://github.com/shadcn.png" alt="@shadcn" fallback="CN">
<AvatarBadge className="bg-green-600 dark:bg-green-800" />
</Avatar>You can also use an icon inside <AvatarBadge>.

Use the AvatarGroup component to add a group of avatars.



Use <AvatarGroupCount> to add a count to the group.



You can also use an icon inside <AvatarGroupCount>.



Use the size prop to change the size of the avatar.



You can use the Avatar component as a trigger for a dropdown menu.
The Avatar component is the root component that wraps the avatar image and fallback.
| Prop | Type | Default |
|---|---|---|
size | "default" | "sm" | "lg" | "default" |
className | string | - |
src | string | - |
alt | string | - |
className | string | - |
fallback | string | <IconUser/> |