Skip to content

Avatar

An image element with a fallback for representing the user.

FO

Installation

npm i @huin-core/react-avatar

API Reference

Avatar

PropTypeDescription
asChildbooleanWhen set to true, renders the component as its child element, inheriting the child's styles and behavior.

AvatarImage

PropTypeDescription
asChildbooleanWhen set to true, renders the component as its child element, inheriting the child's styles and behavior.
onLoadingStatusChangefunctionA callback providing information about the loading status of the image. This is useful in case you want to control more precisely what to render as the image is loading.

AvatarFallback

PropTypeDescription
asChildbooleanWhen set to true, renders the component as its child element, inheriting the child's styles and behavior.
delayMsnumberUseful for delaying rendering so it only appears for those with slower connections.