Vivid API

Avatar

Avatars are used to represent a user or a system entity. They can be used to represent a person, a group of people, or an object.

Appearance

Set the appearance attribute to change the avatar’s appearance.

Connotation

Set the connotation attribute to set the avatar’s color.
Avatar has accent connotation (default) and cta.

Shape

Set the shape attribute to change the avatar’s edges.

Icon

Use the icon slot to display an icon from the icon library on the Avatar.

Initials

Set the initials attribute to set avatar’s initials. This will cause the avatar to present the initials as its content instead of an icon.

Size

Use the size attribute/property to set the avatar’s size.

Clickable Avatar

Use the href attribute to change the avatar wrapper to a link. When doing so, all of the native attributes of <a> are supported, including target.

Avatar as a Button

Setting the clickable-avatar attribute switches the avatar wrapper to a <button>, allowing you to trigger programmatic actions e.g. using the click event.

To ensure accessibility, always add the aria-level attribute when using the href or clickable attributes.