Skip to content

SiAvatarBackgroundColorDirective documentation

selector
[siAvatarBackgroundColor]

The directive provide a CSS variable --background with a color based on the initials or alt text.

Input Properties

NameTypeDefaultDescription
autoColor
booleanfalseAutomatically calculates the background color. If set, color will be ignored.
color
numberundefinedThe desired color index from $element-data-* color tokens. This can be set to any kind of positive integer that is then mapped to a color index. A better way to set a pseudo-random color is to set autoColor to true .

Attributes and Methods

NameTypeDefaultDescription
calculateColorFromInitials(...)
(displayInitials: string) => voidUpdate background color variable based on the initials or placeholder text.

Parameters

Types Documentation

No types to document for items on this page.


Except where otherwise noted, content on this site is licensed under MIT License.