> Markdown version of [Message List](https://vaadin.com/docs/v14/ds/components/message-list). Section index: [llms.txt](https://vaadin.com/docs/v14/ds/llms.txt)

# Message List

Message List allows you to show a list of messages, for example, a chat log. You can configure the text content, information about the sender and the time of sending for each message.

`MessageListComponent.java`

```java
Person person = DataService.getPeople(1).get(0);
MessageList list = new MessageList();
Instant yesterday = LocalDateTime.now().minusDays(1)
        .toInstant(ZoneOffset.UTC);
Instant fiftyMinsAgo = LocalDateTime.now().minusMinutes(50)
        .toInstant(ZoneOffset.UTC);
MessageListItem message1 = new MessageListItem(
        "Linsey, could you check if the details with the order are okay?",
        yesterday, "Matt Mambo");
message1.setUserColorIndex(1);
MessageListItem message2 = new MessageListItem("All good. Ship it.",
        fiftyMinsAgo, "Linsey Listy", person.getPictureUrl());
message2.setUserColorIndex(2);
list.setItems(Arrays.asList(message1, message2));
add(list);
```

The messages in the list can be populated with the `items` property. The `items` property is of type `Array`, with JSON objects in it. Each JSON object is a single message.

## <a id="related-components"></a>Related Components

| Component                                                                   | Usage recommendations                    |
| --------------------------------------------------------------------------- | ---------------------------------------- |
| [Message Input](https://vaadin.com/docs/v14/ds/components/message-input.md) | Allow users to author and send messages. |

`50A56A3D-FC66-4317-B284-501652BE3993`
