Class IgxAvatarComponent

Avatar provides a way to display an image, icon or initials to the user.

IgxAvatarModule

igx-avatar-theme, igx-icon-theme

avatar, profile, picture, initials

Layouts

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.

<igx-avatar initials="MS" shape="rounded" size="large">
</igx-avatar>

Implements

  • OnInit

Constructors

Properties

ariaLabel: string = 'avatar'

Returns the aria-label attribute of the avatar.

let ariaLabel = this.avatar.ariaLabel;
bgColor: string

Sets the background color of the avatar.

<igx-avatar bgColor="yellow"></igx-avatar>

Background color

in version 17.2.0.

color: string

Sets the color of the avatar's initials or icon.

<igx-avatar color="blue"></igx-avatar>

in version 17.2.0.

elementRef: ElementRef<any>
icon: string

Sets an icon to the avatar. All icons from the material icon set are supported.

<igx-avatar icon="phone"></igx-avatar>
id: string = ...

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>
initials: string

Sets initials to the avatar.

<igx-avatar initials="MN"></igx-avatar>
role: string = 'img'

Returns the role attribute of the avatar.

let avatarRole = this.avatar.role;
roleDescription: string

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;
shape: "square" | "circle" | "rounded" = 'square'

Sets square, rounded or circular shape to the avatar. By default the shape of the avatar is square.

<igx-avatar shape="rounded"></igx-avatar>
src: string

Sets the image source of the avatar.

<igx-avatar src="images/picture.jpg"></igx-avatar>

Image URL

Accessors