Skip to main content

Avatar

An avatar is a visual representation of a user or entity.

On this page
MB
Props
<Avatar>
  <AvatarImage alt="@mehdibha" />
  <AvatarFallback>MB</AvatarFallback>
</Avatar>

Installation

npx shadcn@latest add @dotui/avatar

Usage

Use avatars to represent users or entities with an image or initials.

import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar'
<Avatar>
  <AvatarImage src="https://github.com/mehdibha.png" alt="@mehdibha" />
  <AvatarFallback>MB</AvatarFallback>
</Avatar>

Examples

Basic

M

Fallback-only

MB

Sizes

MMM

Radii

MMM

Badge

M

Badge with icon

M

Status badge

M

Badge with notification

M6

Icon fallback

Group

MTD

Group with count

MTD+3

API Reference

Avatar

A visual representation of a user or entity, displayed as an image, initials, or placeholder.

Supports all span attributes.

PropType
"lg" | "md" | "sm"

AvatarImage

The image element displayed within the avatar. Automatically hidden when the image fails to load.

Supports all img attributes.

PropType
string

AvatarFallback

Content displayed when the avatar image fails to load. Typically shows initials or an icon.

Supports all span attributes.

PropType

AvatarBadge

A small indicator displayed on the avatar, typically used to show online status.

Supports all span attributes.

PropType

AvatarGroup

A group container that displays multiple avatars together with overlapping layout.

Supports all div attributes.

PropType
"lg" | "md" | "sm"

AvatarGroupCount

A count indicator displayed at the end of an avatar group to show remaining items.

Supports all span attributes.

PropType

Last updated on 6/16/2026