Docs

Documentation versions (currently viewingVaadin 25 (prerelease))

Avatar Styling

Styling API reference for the Avatar and Avatar Group components.

Style Variants

Avatar and Avatar Group support the following style variants:

Variant Description Supported by

reverse

Reverses the stacking order of avatars in Avatar Group

Aura, Lumo

large

Large avatar size

Lumo

small

Small avatar size

Lumo

xlarge

Extra large avatar size

Lumo

xsmall

Extra small avatar size

Lumo

filled

Uses a solid background color for avatars

Aura

Size Variants

Avatar has four available size variants:

Source code
AvatarSizes.java
avatar-sizes.tsx
avatar-sizes.ts

Size variants should be used only in special cases. Use the --vaadin-avatar-size CSS property to change the default Avatar size.

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

Property Supported by

--vaadin-avatar-background

Aura, Lumo

--vaadin-avatar-border-width

Aura

--vaadin-avatar-border-color

Aura

--vaadin-avatar-group-overlap

Aura, Lumo

--vaadin-avatar-group-gap

Aura, Lumo

--vaadin-avatar-size

Aura, Lumo

User Color Properties

Property Supported by

--vaadin-user-color-0

Aura, Lumo

--vaadin-user-color-1

Aura, Lumo

--vaadin-user-color-2

Aura, Lumo

--vaadin-user-color-3

Aura, Lumo

--vaadin-user-color-4

Aura, Lumo

--vaadin-user-color-5

Aura, Lumo

--vaadin-user-color-6

Aura, Lumo

--vaadin-user-color-7

Aura

--vaadin-user-color-8

Aura

--vaadin-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)

Avatar Group

Root element

vaadin-avatar-group

Avatar in group

vaadin-avatar-group > vaadin-avatar

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