Avatar Styling
Style Variants
Avatar and Avatar Group support the following style variants:
| Variant | Description | Supported by |
|---|---|---|
| Reverses the stacking order of avatars in Avatar Group | Aura, Lumo |
| Large avatar size | Lumo |
| Small avatar size | Lumo |
| Extra large avatar size | Lumo |
| Extra small avatar size | Lumo |
| Uses a solid background color for avatars | Aura |
Style Properties
The following style properties can be used in CSS stylesheets to customize the appearance of this component.
To apply values to these properties globally in your application UI, place them in a CSS block using the html {…} selector.
See Component Style Properties for more information on style properties.
Common Properties
| Feature | Property | Supported by |
|---|---|---|
Avatar size |
| Aura, Lumo |
Avatar background |
| Aura, Lumo |
Avatar border width |
| Aura |
Avatar border color |
| Aura |
Avatar Group overlap |
| Aura, Lumo |
Avatar Group gap |
| Aura, Lumo |
User Color Properties
| Feature | Property | Supported by |
|---|---|---|
User color 0 |
| Aura, Lumo |
User color 1 |
| Aura, Lumo |
User color 2 |
| Aura, Lumo |
User color 3 |
| Aura, Lumo |
User color 4 |
| Aura, Lumo |
User color 5 |
| Aura, Lumo |
User color 6 |
| Aura, Lumo |
User color 7 |
| Aura |
User color 8 |
| Aura |
User color 9 |
| Aura |
CSS Selectors
The following CSS selectors can be used in stylesheets to target the various parts and states of the component. See the Styling documentation for more details on how to style components.
Avatar
- Root element
-
vaadin-avatar - Hovered avatar
-
vaadin-avatar:hover - Focused avatar
-
vaadin-avatar[focused] - Avatar with color index
-
vaadin-avatar[has-color-index] - Overflow avatar
-
vaadin-avatar[slot="overflow"] - Expanded overflow avatar
-
vaadin-avatar[aria-expanded="true"] - Avatar icon
-
vaadin-avatar::part(icon) - Avatar abbreviation
-
vaadin-avatar::part(abbr)
Overlay
- Overlay background
-
vaadin-avatar-group::part(overlay) - Overlay content wrapper
-
vaadin-avatar-group::part(content) - Menu inside overlay
-
vaadin-avatar-group-menu - Item element
-
vaadin-avatar-group-menu-item - Hovered item
-
vaadin-avatar-group-menu-item:hover - Focused item
-
vaadin-avatar-group-menu-item[focused] - Item content wrapper
-
vaadin-avatar-group-menu-item::part(content) - Item avatar
-
vaadin-avatar-group-menu-item> vaadin-avatar