Avatar

Represent people or teams with images, icons, or initials.

Live preview
Interact with the component to see results here.
View code
HTML
<sy-avatar
  text="Alex Kim"
  variant="purple"
  size="medium"
></sy-avatar>

Usage guide

#

Help users quickly identify people or organizations alongside their names. The available representation with the highest priority is shown.

Display priority

  1. image
  2. icon
  3. letter
  4. 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 the selected event.
Multiple users
Users beyond the group's maxCount appear in an overflow area. Choose stack or grid layout.

Feature examples

#

Choose a feature from 18 topics. Explore property settings, method calls, event results, and slot layouts through live examples and code.

Usage examples · Group Overview

Try the selected example. Topics with multiple configurations let you switch between detailed examples.

View code
HTML
Loading the example.

Usage examples · Overview

Try the selected example. Topics with multiple configurations let you switch between detailed examples.

View code
HTML
Loading the example.

Property · Clickable

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Disabled

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Group Clickable

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Group Max Count

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Group Size

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Group Variant

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Icon

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Image

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Letter

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Size

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Text

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Tooltip Content

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Variant

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Events · Disable Status

Interact with the component to see event names and payloads in the live preview below.

View code
HTML
Loading the example.

Events · Selected

Interact with the component to see event names and payloads in the live preview below.

View code
HTML
Loading the example.

Usage examples · Avatar description

Set tooltipContent to a full name or role. Hover over the avatar to see it.

View code
HTML
<sy-avatar
  text="Alex Kim"
  variant="purple"
  size="medium"
  tooltipcontent="Alex Kim · Product designer"
  id="supplement-1"
></sy-avatar>

<script type="module">
  const component1 = document.querySelector("#supplement-1");
  Object.assign(component1, {
    "tooltipContent": "Alex Kim · Product designer"
  });
</script>

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 / PropertyTypeDefaultDescription
booleanfalseAllow user selection and emit the selected event.
booleanfalseBlock 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

EventDetailDescription
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 / PropertyTypeDefaultDescription
booleanfalseAllow user selection and emit the selected event.
numberInfinity as anyMaximum 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

EventDetailDescription
CustomEvent<{ letter: string; text: string; icon: string; image: string; }>Emitted when the user selects an item.

Slots

SlotDescription
Component body or child items.