AvatarGroupElement
<vaadin-avatar-group> is a Web Component providing avatar group displaying functionality.
To create the avatar group, first add the component to the page:
<vaadin-avatar-group></vaadin-avatar-group>And then use #/elements/vaadin-avatar-group#property-items property to initialize the structure:
document.querySelector('vaadin-avatar-group').items = [
{name: 'John Doe'},
{abbr: 'AB'}
];Styling
The following shadow DOM parts are exposed for styling:
| Part name | Description |
|---|---|
container | The container element |
overlay | The overflow avatar menu overlay |
content | The overflow avatar menu overlay content |
The following custom CSS properties are available for styling:
| Custom CSS property |
|---|
--vaadin-avatar-group-gap |
--vaadin-avatar-group-overlap |
See the #/elements/vaadin-avatar documentation for the available state attributes and stylable shadow parts of avatar elements.
See Styling Components documentation.
Internal components
In addition to <vaadin-avatar-group> itself, the following internal components are themable:
<vaadin-avatar-group-menu>- has the same API as #/elements/vaadin-list-box.<vaadin-avatar-group-menu-item>- has the same API as #/elements/vaadin-item.
Properties
An array containing the items which will be stamped as avatars.
The maximum number of avatars to display. By default, all the avatars are displayed. When maxItemsVisible is set, the overflowing avatars are grouped into one avatar with a dropdown. Setting 0 or 1 has no effect so there are always at least two avatars visible.