Skip to content

头像 Avatar

用于代表用户或实体的图像元素。

基础用法

RVCN
Example

尺寸

使用 size 属性来控制头像的大小。

XSSMMDLGXL2XL
Example

形状

使用 shape 属性来控制头像的形状。

CIROSQ
Example

头像组

使用 BrAvatarGroup 组件将多个头像堆叠在一起。

U1U2U3
+2
U1U2U3U4
+6
Example

头像徽标

使用 BrAvatarBadge 组件显示状态徽标。

RVCNABXY
Example

API

BrAvatar

Props

属性名类型默认值说明
sizestring'md'尺寸变体:xs, sm, md, lg, xl, 2xl
shapestring'circle'形状变体:circle, square, rounded
borderedbooleanfalse是否显示边框

BrAvatarImage

Props

属性名类型说明
srcstring图片源地址
altstring图片替代文本

BrAvatarFallback

Props

属性名类型说明
delayMsnumber显示回退内容前的延迟(毫秒)

BrAvatarGroup

Props

属性名类型默认值说明
maxnumber-最大显示的头像数量
sizestring'md'组内头像的尺寸
shapestring'circle'组内头像的形状
borderedbooleantrue是否显示头像边框

BrAvatarBadge

Props

属性名类型默认值说明
statusstring'online'状态:online, offline, busy, away
positionstring'bottom-right'徽标位置:top-right, bottom-right, top-left, bottom-left