Avatar

An image element with a fallback for representing the user.

@shadcn
User 2
CN
JD
AS
User 3
MN
3
A
B
+2

Installation

CLI

Install the component using the StarUI CLI:

star add avatar

Examples

Basic Avatar

Simple avatar with image

@shadcn
CN
User

Sizes

Avatars in different sizes

XS
SM
MD
LG
XL
2X

Fallback

Avatar with initials fallback

CN
JD
AB

Automatic Fallback

Automatically extract initials from name

@shadcn
CN

Valid URL

Invalid
IN

Invalid URL

NI

No URL

Avatar Group

Display multiple avatars together

JD
AS
PQ
+2

With Badge

Avatar with status badge

JD
AS
PQ
MN
5

Colored Initials

Avatars with colored backgrounds

JD
AS
PQ
MN
XY

API Reference

Component Description
Avatar Main avatar container
AvatarImage Image displayed in avatar
AvatarFallback Fallback content when image fails or loads