Skip to content

SiAvatarComponent documentation

selector
si-avatar

Input Properties

NameTypeDefaultDescription
altText
Required
stringThe alt text for image, title for other modes.
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 .
icon
stringIcon name when using an icon.
imageUrl
stringImage src URL when using an image.
initials
stringInitials to be displayed as default avatar if no icon or imageUrl are provided. If also no initials are provided, they will be automatically calculated from the altText . The value will be used to calculate the background color when autoColor is true.
size
AvatarSize'regular'Size of the component.
status
EntityStatusTypeThe status (success, info, warning, caution, danger, critical, pending, progress) to be visualized.
statusAriaLabel
TranslatableStringaria-label for status

Types Documentation

("tiny" | "xsmall" | "small" | "regular" | "large" | "xlarge")
Represents a translatable string. This can either be a translation key, e.g. ACTIONS.EDIT that will be automatically translated when displayed on the UI or a pre-translated string, e.g. Edit . Equivalent to a normal string in usage and functionality.
Translatable
import
("success" | "info" | "warning" | "danger" | "caution" | "critical")
The 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 .

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