Avatar
Avatars can be used to represent people or objects. It supports images, Icons, or characters.
Basic Usage
Use shape and size prop to set avatar's shape and size.
Types
It supports images, Icons, or characters.
Fallback
fallback when image load error.
Fit Container
Set how the image fit its container for an image avatar, same as object-fit.
API
Attributes
| Name | Description | Type | Default |
|---|---|---|---|
| icon | representation type to icon, more info on icon component. | string / Component | — |
| size | avatar size. | number / enum | default |
| shape | avatar shape. | enum | circle |
| src | the source of the image for an image avatar. | string | — |
| src-set | native attribute srcset of image avatar. | string | — |
| alt | native attribute alt of image avatar. | string | — |
| fit | set how the image fit its container for an image avatar. | enum | cover |
Events
| Name | Description | Type |
|---|---|---|
| error | trigger when image load error. | Function |
Slots
| Name | Description |
|---|---|
| default | customize avatar content. |