Sizes
Avatar.Image keepMounted
Set keepMounted when a stacked fallback or image optimizer needs the <img> node to stay in the DOM even after a load error.
API Reference
Props mirror Base UI React where applicable, adapted for Svelte 5. Native HTML attributes for the rendered element are also accepted unless noted.
Avatar.Root
Displays a user's profile picture, initials, or fallback icon. Renders a <span> element.
Props
Avatar.Fallback
Rendered when the image fails to load or when no image is provided. Renders a <span> element.
Props
Avatar.Image
The image to be displayed in the avatar. Renders an <img> element.
Props
onLoadingStatusChange function —
- Description
Callback fired when the loading status changes.
- Type
((status: ImageLoadingStatus) => void) | undefined
keepMounted boolean false
- Name
keepMounted- Description
When
true, keep the image element mounted even after an error (useful for stacked fallbacks and image optimizers that need the node present).- Type
boolean- Default
false