- components
 - ›
 - avatar
 - ›
 - react
 
Avatar
An image with a fallback for representing the user.
Fallback
Use <Avatar.Fallback> to provide initials, icons, or a framework-specific image component.
SK
Filter
Avatars can implement SVG Filters using the image className attribute.
API Reference
Root
| Property | Default | Type | 
|---|---|---|
 onStatusChange  |  - |    ((details: StatusChangeDetails) => void) | undefinedFunctional called when the image loading status changes.  |  
 ids  |  - |    Partial<{ root: string; image: string; fallback: string; }> | undefined The ids of the elements in the avatar. Useful for composition.  |  
 getRootNode  |  - |    (() => ShadowRoot | Node | Document) | undefinedA root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.  |  
 dir  |  "ltr" |    "ltr" | "rtl" | undefinedThe document's text/writing direction.  |  
 element  |  - |    ((attributes: HTMLAttributes<"div">) => Element) | undefinedRender the element yourself  |  
RootProvider
| Property | Default | Type | 
|---|---|---|
 value  |  - |    AvatarApi<PropTypes>  |  
 element  |  - |    ((attributes: HTMLAttributes<"div">) => Element) | undefinedRender the element yourself  |  
RootContext
| Property | Default | Type | 
|---|---|---|
 children  |  - |    (avatar: AvatarApi<PropTypes>) => ReactNode  |  
Image
| Property | Default | Type | 
|---|---|---|
 element  |  - |    ((attributes: HTMLAttributes<"img">) => Element) | undefinedRender the element yourself  |  
Fallback
| Property | Default | Type | 
|---|---|---|
 element  |  - |    ((attributes: HTMLAttributes<"span">) => Element) | undefinedRender the element yourself  |