Avatar
Represent people or teams with images, icons, or initials.
Usage guide
#Help users quickly identify people or organizations alongside their names. The available representation with the highest priority is shown.
Display priority
imageiconletter- Initials in
text
- When no image is available
- Also provide a name so initials can be displayed.
- Navigate to a profile
- With
clickable, handle navigation in your app through theselectedevent. - Multiple users
- Users beyond the group's
maxCountappear in an overflow area. Choosestackorgridlayout.
Examples
#Feature examples
#Choose a feature from 18 topics. Explore property settings, method calls, event results, and slot layouts through live examples and code.
No matching features.
API reference
#Hover over a name or focus it with the keyboard to see the code. On touch screens, tap the name.
<sy-avatar>
Properties
| Attribute / Property | Type | Default | Description |
|---|---|---|---|
boolean | false | Allow user selection and emit the selected event. | |
boolean | false | Block user interaction and keyboard focus. | |
string | '' | Profile image URL. | |
string | '' | SVG string displayed in the profile. | |
string | '' | User name used to derive initials. | |
string | '' | Explicit initials, up to two characters. | |
| 'lightgray' | 'red' | 'orange' | 'yellow' | 'lime' | 'green'
| 'teal' | 'blue' | 'purple' | 'magenta' | 'darkgray' | 'lightgray' | Component display style. | |
'small' | 'medium' | 'large' | 'medium' | Component size. | |
string | '' | User description shown on hover. |
Events
| Event | Detail | Description |
|---|---|---|
CustomEvent<{
letter: string;
text: string;
icon: string;
image: string;
}> | Emitted when the user selects an item. | |
CustomEvent<{ disabled: boolean }> | Read the result from the event's detail. |
<sy-avatar-group>
Properties
| Attribute / Property | Type | Default | Description |
|---|---|---|---|
boolean | false | Allow user selection and emit the selected event. | |
number | Infinity as any | Maximum number of people shown. Remaining people appear in an overflow indicator. | |
'small' | 'medium' | 'large' | 'medium' | Component size. | |
'stack' | 'grid' | 'stack' | stack overlaps items; grid places them side by side. |
Events
| Event | Detail | Description |
|---|---|---|
CustomEvent<{
letter: string;
text: string;
icon: string;
image: string;
}> | Emitted when the user selects an item. |
Slots
| Slot | Description |
|---|---|
| Component body or child items. |