Returns the aria-label
attribute of the avatar.
let ariaLabel = this.avatar.ariaLabel;
Sets the background color of the avatar.
<igx-avatar bgColor="yellow"></igx-avatar>
Background color
Sets the color of the avatar's initials or icon.
<igx-avatar color="blue"></igx-avatar>
Sets an icon to the avatar. All icons from the material icon set are supported.
<igx-avatar icon="phone"></igx-avatar>
Sets the id
of the avatar. If not set, the first avatar component will have id
= "igx-avatar-0"
.
<igx-avatar id="my-first-avatar"></igx-avatar>
Sets initials to the avatar.
<igx-avatar initials="MN"></igx-avatar>
Returns the role
attribute of the avatar.
let avatarRole = this.avatar.role;
Returns the type of the avatar. The avatar can be:
"initials type avatar"
"icon type avatar"
"image type avatar"
."custom type avatar"
.let avatarDescription = this.avatar.roleDescription;
Sets square, rounded or circular shape to the avatar. By default the shape of the avatar is square.
<igx-avatar shape="rounded"></igx-avatar>
Sets the image source of the avatar.
<igx-avatar src="images/picture.jpg"></igx-avatar>
Image URL
Returns the size of the avatar.
let avatarSize = this.avatar.size;
Sets the size of the avatar.
By default, the size is "small"
. It can be set to "medium"
or "large"
.
<igx-avatar size="large"></igx-avatar>
Returns the type of the avatar.
let avatarType = this.avatar.type;
Avatar provides a way to display an image, icon or initials to the user.
Igx Module
IgxAvatarModule
Igx Theme
igx-avatar-theme, igx-icon-theme
Igx Keywords
avatar, profile, picture, initials
Igx Group
Layouts
Remarks
The Ignite UI Avatar provides an easy way to add an avatar icon to your application. This icon can be an image, someone's initials or a material icon from the Google Material icon set.
Example