Skip to main content

Component <Avatar />

Props

PropsTypeMeaningPossible values
widthnumberChange avatar widthfrom 0 to any number
heightnumberChange avatar heightfrom 0 to any number
radiusstringSet border radiusrounded / squared
srcstringSet avatar image urlimage path
altstringSet avatar alternative textimage alternative name
fitstringChange how an image should scale if the dimensions of the image are different from avatarcover / contain
colorstringChange avatar backgound. Works only with 'children' propprimary / dark / white / transparent
fontSizenumberChange avatar text font sizefrom 0 to any number



Sizes

Examples:

<Avatar width={32} height={32} src="gift.svg" alt="avatar" />
<Avatar width={48} height={48} src="gift.svg" alt="avatar" />
<Avatar width={64} height={64} src="gift.svg" alt="avatar" />
avatar
avatar
avatar



Shapes

Examples:

<Avatar radius="0" src="gift.svg" alt="avatar" />
<Avatar radius="12px" src="gift.svg" alt="avatar" />
<Avatar radius="50%" src="gift.svg" alt="avatar" />
avatar
avatar
avatar



Fits

Examples:

<Avatar width={64} height={48} fit="contain" src="gift.svg" alt="avatar" />
<Avatar width={64} height={48} fit="cover" src="gift.svg" alt="avatar" />
avatar
avatar



Text

Examples:

<Avatar>T</Avatar>
<Avatar>E</Avatar>
<Avatar>XT</Avatar>
T
E
XT



Text Colors

Examples:

<Avatar color="primary">T</Avatar>
<Avatar color="white">E</Avatar>
<Avatar color="dark">X</Avatar>
<Avatar color="transparent">T</Avatar>
T
E
X
T



Text Size

Examples:

<Avatar fontSize={34}>C</Avatar>
<Avatar fontSize={14}>Nick</Avatar>
<Avatar fontSize={10}>Money</Avatar>
C
Nick
Money