Avatar
Represents a user or entity with a recognizable image or placeholder in UI elements.
Structure
API Reference
The root component used to set and manage the state of the avatar.
Property | Type | Description |
---|---|---|
loadingStatus bindable prop | enum | The loading status of the avatars source image. You can bind a variable to track the status outside of the component and use it to show a loading indicator or error message. Default: undefined |
onLoadingStatusChange | function | A callback function called when the loading status of the image changes. Default: undefined |
delayMs | number | How long to wait before showing the image after it has loaded. This can be useful to prevent a harsh flickering effect when the image loads quickly. Default: 0 |
child | Snippet | Use render delegation to render your own element. See render delegation for more information. Default: undefined |
children | Snippet | The children content to render. Default: undefined |
ref | HTMLDivElement | The underlying DOM element being rendered. You can bind to this to get a reference to the element. Default: undefined |
Data Attribute | Value | Description |
---|---|---|
data-avatar-root | —— | Present on the root element. |
The avatar image displayed once it has loaded.
Property | Type | Description |
---|---|---|
child | Snippet | Use render delegation to render your own element. See render delegation for more information. Default: undefined |
children | Snippet | The children content to render. Default: undefined |
ref | HTMLImageElement | The underlying DOM element being rendered. You can bind to this to get a reference to the element. Default: undefined |
Data Attribute | Value | Description |
---|---|---|
data-avatar-image | —— | Present on the image element. |
The fallback displayed while the avatar image is loading or if it fails to load
Property | Type | Description |
---|---|---|
child | Snippet | Use render delegation to render your own element. See render delegation for more information. Default: undefined |
children | Snippet | The children content to render. Default: undefined |
ref | HTMLSpanElement | The underlying DOM element being rendered. You can bind to this to get a reference to the element. Default: undefined |
Data Attribute | Value | Description |
---|---|---|
data-avatar-fallback | —— | Present on the fallback element. |