Docs

Documentation versions (currently viewingVaadin 25.1 (pre-release))

Message List Styling

Styling API reference for the Message List component.

Styling Individual Messages

You can style individual messages by adding a class name to some items and providing CSS for that class name. The following example shows how to highlight the current user’s own messages:

Source code
MessageListClassName.java
message-list-class-name.css
message-list-class-name.css
message-list-class-name.tsx
message-list-class-name.css
message-list-class-name.css
message-list-class-name.ts
message-list-class-name.css
message-list-class-name.css

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.

Property Supported by

--vaadin-message-font-size

Aura, Lumo

--vaadin-message-font-weight

Aura, Lumo

--vaadin-message-gap

Aura, Lumo

--vaadin-message-header-line-height

Aura, Lumo

--vaadin-message-line-height

Aura, Lumo

--vaadin-message-list-padding

Aura, Lumo

--vaadin-message-name-color

Aura, Lumo

--vaadin-message-name-font-size

Aura, Lumo

--vaadin-message-name-font-weight

Aura, Lumo

--vaadin-message-padding

Aura, Lumo

--vaadin-message-text-color

Aura, Lumo

--vaadin-message-time-color

Aura, Lumo

--vaadin-message-time-font-size

Aura, Lumo

--vaadin-message-time-font-weight

Aura, Lumo

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.

Important
Not for Shadow DOM
These selectors should be used in styles.css or another stylesheet loaded with the @StyleSheet annotation or the @import CSS rule. They do not work in the shadow DOM of Vaadin components, such as in stylesheets in the components sub-folder or loaded with the @CssImport annotation’s themeFor property.

List

Root element

vaadin-message-list

Internal list layout

vaadin-message-list::part(list)

Message

Root element

vaadin-message

Text content layout

vaadin-message::part(content)

Header row

vaadin-message::part(header)

Name

vaadin-message::part(name)

Timestamp

vaadin-message::part(time)

Message text

vaadin-message::part(message)

Attachments

Note
Preview Feature

This is a preview version of Message List Attachments. You need to enable it with the feature flag com.vaadin.experimental.messageListAttachments. Preview versions may lack some planned features, and breaking changes may be introduced in any Vaadin version. We encourage you to try it out and provide feedback to help us improve it.

Attachments container

vaadin-message::part(attachments)

Attachment button

vaadin-message::part(attachment)

Image attachment button

vaadin-message::part(attachment attachment-image)

File attachment button

vaadin-message::part(attachment attachment-file)

Image thumbnail

vaadin-message::part(attachment-preview)

File icon

vaadin-message::part(attachment-icon)

File name

vaadin-message::part(attachment-name)

Avatars

Avatar

vaadin-message > vaadin-avatar

Avatar icon

vaadin-message > vaadin-avatar::part(icon)

Avatar abbreviation

vaadin-message > vaadin-avatar::part(abbr)