Avatars can be used to represent people or objects. It supports images, Icons, or characters.


use shape and size prop to set avatar's shape and size


It supports images, Icons, or characters

Fallback when image load error

fallback when image load error

How the image fit its container

Set how the image fit its container for an image avatar, same as object-fit.


AttributeDescriptionTypeAccepted ValuesDefault
iconset representation type to Icon, more info on Icon Componentstring / Component
sizeset avatar sizenumber / stringnumber / large / default /smalldefault
shapeset avatar shapestringcircle / squarecircle
srcthe address of the image for an image avatarstring
srcSetA list of one or more strings separated by commas indicating a set of possible image sources for the user agent to usestring
altThis attribute defines an alternative text description of the imagestring
fitset how the image fit its container for an image avatarstringfill / contain / cover / none / scale-downcover


Event NameDescriptionParameters
errorhandler when img load error, return false to prevent default fallback behavior(e: Event)


defaultcustomize avatar content