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.

circle
square

Types

It supports images, Icons, or characters.

user

Fallback

fallback when image load error.

Fit Container

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

fill
contain
cover
none
scale-down

Avatar Group 2.13.1

Displayed as a avatar group.

Use tag <el-avatar-group> to group your avatars.

default

use collapse-avatars

+ 4

use collapse-class and collapse-style

+ 4

use max-collapse-avatars

+ 2

use collapse-avatars-tooltip

+ 2

Avatar API

Avatar Attributes

NameDescriptionTypeDefault
iconrepresentation type to icon, more info on icon component.string / Component
sizeavatar size.number / enum
shapeavatar shape.enum
srcthe source of the image for an image avatar.string
src-setnative attribute srcset of image avatar.string
altnative attribute alt of image avatar.string
fitset how the image fit its container for an image avatar.enumcover

Avatar Events

NameDescriptionType
errortrigger when image load error.Function

Avatar Slots

NameDescription
defaultcustomize avatar content.

AvatarGroup API 2.13.1

AvatarGroup Attributes

NameDescriptionTypeDefault
sizecontrol the size of avatars in this avatar-groupnumber / enum
shapecontrol the shape of avatars in this avatar-groupenum
collapse-avatarswhether to collapse avatarsbooleanfalse
collapse-avatars-tooltipwhether show all collapsed avatars when mouse hover text of the collapse-avatar. To use this, collapse-avatars must be truebooleanfalse
max-collapse-avatarsthe max avatars number to be shown. To use this, collapse-avatars must be truenumber1
effecttooltip theme, built-in theme: dark / lightenum / stringlight
placementplacement of tooltipenumtop
popper-classcustom class name for tooltipstring''
popper-stylecustom style for tooltipstring / object
collapse-classcustom class name for the collapse-avatarstring''
collapse-stylecustom style for the collapse-avatarstring / object

Source

ComponentStyleDocs

Contributors