Avatars can be used to represent a person, company or object. It can be a photo, icon, or letters.
XelaUserAvatar(
size: .Large,
style: .Circle,
initials: "XE"
)
XelaUserAvatar(
size: .Large,
style: .Rectangle,
initials: "XE",
decoration: .Indicator,
decorationPosition: .BottomRight
)
XelaUserAvatar(
size: .Large,
style: .Circle,
initials: "XE",
count: 2,
decoration: .Counter
)
Name | Type | Default Value | Required | Description |
---|---|---|---|---|
size | XelaUserAvatarSize | - | YES | Size for avatar (.Large, .Medium, .Small) |
style | XelaUserAvatarStyle | - | YES | Style for avatar (.Circle, .Rectangle) |
initials | String? | nil | NO | Initials String for avatar |
icon | String? | nil | NO | Icon name from Assets |
image | Image? | nil | NO | Image View for avatar |
count | Int | 0 | NO | Count for decoration .Counter |
decoration | XelaUserAvatarDecoration? | nil | NO | Decoration for avatar (.Counter, .Indicator, .Plus) |
decorationPosition | XelaUserAvatarDecorationPosition | .TopRight | NO | Decoration Position for avatar (.BottomRight, .TopRight) |
background | Color | Color(xelaColor: .Blue7) | NO | Background color for avatar |
foreground | Color | Color(.white) | NO | Foreground color for icon rendered as template or initials |