Avatars are visual representations of users' accounts that can be presented by an image or initials.

Overview

Avatars can be used inside of other components or by themselves to represent the user.

Avatars can display an image or simply the initials of the profile. A randomly generated AA accessible background will fill behind the initials. That generated fill will stay assigned to the user until their account is deleted or an image is used.

Sample

Usage

  • Quick representation of the user or groups of users
  • Within Chips for filtering
  • User profiles

API reference

Properties

PropertyAttributeDescriptionTypeDefault
fullNamefull-name

Specifies the full name of the user. When label and thumbnail are not defined, specifies the accessible name for the component.

string
labellabel

Specifies alternative text when thumbnail is defined, otherwise specifies an accessible label for the component.

string
scalescale

Specifies the size of the component.

Scale"m"
thumbnailthumbnail

Specifies the src to an image. If the image is private, include an access token in the URL.

string
userIduser-id

Specifies the unique id of the user.

string
usernameusername

Specifies the username of the user.

string

Styles

NameDescription
--calcite-avatar-corner-radius

Specifies the component's corner radius.

--calcite-avatar-color

Specifies the component's icon or initial color.

--calcite-avatar-background-color

Specifies the component's background color.

Methods

NameDescriptionSignature
componentOnReady

Creates a promise that resolves once the component is fully loaded.

componentOnReady(): Promise<this>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.