Fallback
Use a fallback when an image fails to load or is unavailable.
Filter
Apply SVG Filters to avatar images.
API Reference
Root
isolate bg-surface-400-600 size-16 rounded-full overflow-hidden| Prop | Default | Type | 
|---|---|---|
onStatusChange | — | ((details: StatusChangeDetails) => void) | undefined Functional 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) | undefined A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.  | 
dir | "ltr" | "ltr" | "rtl" | undefined The document's text/writing direction.  | 
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself  | 
Provider
| Prop | Default | Type | 
|---|---|---|
value | — | AvatarApi<PropTypes> | 
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself  | 
Context
| Prop | Default | Type | 
|---|---|---|
children | — | (avatar: AvatarApi<PropTypes>) => ReactNode | 
Image
w-full object-cover| Prop | Default | Type | 
|---|---|---|
element | — | ((attributes: HTMLAttributes<"img">) => Element) | undefined Render the element yourself  | 
Fallback
size-full flex justify-center items-center| Prop | Default | Type | 
|---|---|---|
element | — | ((attributes: HTMLAttributes<"span">) => Element) | undefined Render the element yourself  | 
Root
isolate bg-surface-400-600 size-16 rounded-full overflow-hidden| Prop | Default | Type | 
|---|---|---|
onStatusChange | — | ((details: StatusChangeDetails) => void) | undefined Functional 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) | undefined A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.  | 
dir | "ltr" | "ltr" | "rtl" | undefined The document's text/writing direction.  | 
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself  | 
Provider
| Prop | Default | Type | 
|---|---|---|
value | — | () => AvatarApi<PropTypes> | 
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself  | 
Context
| Prop | Default | Type | 
|---|---|---|
children | — | Snippet<[() => AvatarApi<PropTypes>]> | 
Image
w-full object-cover| Prop | Default | Type | 
|---|---|---|
element | — | Snippet<[HTMLAttributes<"img">]> | undefined Render the element yourself  | 
Fallback
size-full flex justify-center items-center| Prop | Default | Type | 
|---|---|---|
element | — | Snippet<[HTMLAttributes<"span">]> | undefined Render the element yourself  |