Avatar

A graphical representation of the user, often used in profile sections.

JD

Anatomy

To set up the avatar correctly, you’ll need to understand its anatomy and how we name its parts.

Each part includes a data-part attribute to help identify them in the DOM.

Examples

Learn how to use the Avatar component in your project. Let’s take a look at the most basic example:

Handling Events

Avatar allows you to listen for loading state changes.

API Reference

Root

PropTypeDefault
asChild
boolean
id
string
ids
Partial<{ root: string; image: string; fallback: string }>
onStatusChange
(details: StatusChangeDetails) => void

Fallback

PropTypeDefault
asChild
boolean

Image

PropTypeDefault
asChild
boolean