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
avatar
avatar
avatar
avatar
square
avatar
avatar
avatar
avatar

Types

It supports images, Icons, or characters.

avatar
user

Fallback

fallback when image load error.

avatar

Fit Container

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

fillavatar
containavatar
coveravatar
noneavatar
scale-downavatar

Avatar Group 2.13.1

Displayed as a avatar group.

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

default

avataravataravataravataravatar

use collapse-avatars

avatar+ 4

use collapse-class and collapse-style

avatar+ 4

use max-collapse-avatars

avataravataravatar+ 2

use collapse-avatars-tooltip

avataravataravatar+ 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—