- 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
Fallback
size-full flex justify-center items-center
Property | Default | Type |
---|---|---|
element | - | ((attributes: HTMLAttributes<"span">) => Element) | undefinedRender the element yourself |
Image
w-full object-cover
Property | Default | Type |
---|---|---|
element | - | ((attributes: HTMLAttributes<"img">) => Element) | undefinedRender the element yourself |
RootProvider
Property | Default | Type |
---|---|---|
value | - | AvatarApi<PropTypes> |
element | - | ((attributes: HTMLAttributes<"div">) => Element) | undefinedRender the element yourself |
Root
isolate bg-surface-400-600 size-16 rounded-full overflow-hidden
Property | Default | Type |
---|---|---|
onStatusChange | - | ((details: StatusChangeDetails) => void) | undefinedFunctional called when the image loading status changes. |
ids | - | Partial<{ root: string; image: string; fallback: string; }> | undefinedThe 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 |
RootContext
Property | Default | Type |
---|---|---|
children | - | (avatar: AvatarApi<PropTypes>) => ReactNode |