Avatar - Skeleton

Skeleton

  1. components
  2. avatar
  3. react

Avatar

An image with a fallback for representing the user.

SK

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.

SK

API Reference

Fallback

size-full flex justify-center items-center
Property Default Type
element -
((attributes: HTMLAttributes<"span">) => Element) | undefined
Render the element yourself

Image

w-full object-cover
Property Default Type
element -
((attributes: HTMLAttributes<"img">) => Element) | undefined
Render the element yourself

RootProvider

Property Default Type
value -
AvatarApi<PropTypes>
element -
((attributes: HTMLAttributes<"div">) => Element) | undefined
Render the element yourself

Root

isolate bg-surface-400-600 size-16 rounded-full overflow-hidden
Property 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

RootContext

Property Default Type
children -
(avatar: AvatarApi<PropTypes>) => ReactNode