Avatar

The Avatar component builds on the Button and Image components. By default, it set the node of the Image to the Button's startIcon prop and userName to the Button's label.

Props

Props of the Button component are also available.
NameTypeDefaultDescription
ComponentnodeButtonThe component used for the root node
ImageComponentnodeImageThe component used for the image
ImageComponentPropsobjectPassing props to the ImageComponent
userNamestringUse like the button label
letterstringif there is no image, this can be used instead of the first character of the userName
imagePropNamestring'startIcon'This prop name is used when entering the Image node value for the root (Button, MenuItem, Label) component
The ref is forwarded to the root element.

AvatarBox

The AvatarBox component builds on the Button and Image and Typography and components.

Props

Props of the Button component are also available.
NameTypeDefaultDescription
ComponentnodeButtonThe component used for the root node
ImageComponentnodeImageThe component used for the image
ImageComponentPropsobjectPassing props to the ImageComponent
PaperComponentnodeImageIt used for the background node of the letter or the image
PaperComponentPropsobjectPassing props to the PaperComponent
imageSizestringUsable to set custom image size css value eg.: "120px"
userNamestringAvatar heading
letterstringif there is no image, this can be used instead of the first character of the userName
UserNameComponentnodeTypographyThe component used for the userName text
UserNameComponentPropsobjectPassing props to the UserNameComponent
secondaryTextstringText below the user name text
SecondaryTextComponentnodeTypographyThe component used for the SecondaryText text
SecondaryTextComponentPropsobjectPassing props to the SecondaryTextComponent
welcomeTextstringText above the user name text
WelcomeTextComponentnodeTypographyThe component used for the WelcomeText text
WelcomeTextComponentPropsobjectPassing props to the WelcomeTextComponent
inlineboolif true, the texts are displayed in the column next to the avatar image
The ref is forwarded to the root element.

Example

Avatar like a button
Different variants
Like an icon button
Circle
Without image
J
J
J
Avatar like a label
John Doe
John Doe
John Doe
MenuItem
John Doe
Menu
AvatarBox
Hello,
John Doe
Without image
J
Hello,
John Doe
AvatarBox 2
John Doe
lorem ipsum