# Avatar An image with a fallback for representing the user. ```tsx import { Avatar } from '@skeletonlabs/skeleton-react'; export default function Default() { return ( SK ); } ``` ## Fallback Use `` to provide initials, icons, or a framework-specific image component. ```tsx import { Avatar } from '@skeletonlabs/skeleton-react'; export default function Fallback() { return ( SK ); } ``` ## Filter Avatars can implement [SVG Filters](/docs/guides/cookbook/svg-filters) using the image `className` attribute. ```tsx import { Avatar } from '@skeletonlabs/skeleton-react'; export default function Filter() { return ( <> SK ); } ``` ## API Reference ### AvatarRootProps | Property | Default | Type | Description | | --------------- | ------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | | 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 | ### AvatarRootProviderProps | Property | Default | Type | Description | | -------- | ------- | -------------------------------------------------------------- | --------------------------- | | value | - | AvatarApi\ | - | | element? | - | ((attributes: HTMLAttributes\<"div">) => Element) \| undefined | Render the element yourself | ### AvatarRootContextProps | Property | Default | Type | Description | | -------- | ------- | -------------------------------------------- | ----------- | | children | - | (avatar: AvatarApi\) => ReactNode | - | ### AvatarImageProps | Property | Default | Type | Description | | -------- | ------- | -------------------------------------------------------------- | --------------------------- | | element? | - | ((attributes: HTMLAttributes\<"img">) => Element) \| undefined | Render the element yourself | ### AvatarFallbackProps | Property | Default | Type | Description | | -------- | ------- | --------------------------------------------------------------- | --------------------------- | | element? | - | ((attributes: HTMLAttributes\<"span">) => Element) \| undefined | Render the element yourself |