Usage
Chat Message List contains chronological message and system-update nodes within the Chat family. Give each list a concise aria-label and keep consumer content in source order.
import "@nordhealth/components/lib/ChatMessageList"
Composition
Chat Message List is the chronological log within Chat. Consumer-owned Chat Message and Chat System Message nodes remain in DOM order, while empty content, streaming state, and older-message loading change the list state without replacing those nodes.
Examples
Conversation state
The list exposes a polite role="log" which announces additions without repeatedly announcing streamed text mutations. Set streaming while the latest response is incomplete; this adds aria-busy without changing the consumer-owned messages. The empty slot is shown until message rows exist.
Set load-older to enable the leading observer sentinel. It emits one nord-load-more event when eligible, and requestOlder() exposes the same intent for a custom trigger. When used inside Chat, prepending the original older nodes preserves the reader’s visual scroll anchor.
Accessibility
Use one stable label which distinguishes this log from other live regions. Keep actions and messages in chronological DOM order, and use Chat System Message for concise status announcements rather than broadening the log’s live-region behavior.
Templates
See this component composed into complete application views:
API reference
ChatMessageList
Chat Message List is an accessible conversation log which preserves direct consumer children and coordinates loading older messages with Chat.
<nord-chat-message-list></nord-chat-message-list>Props
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
density | density | Optional density override. Otherwise inherits the surrounding chat density. | ChatDensity | undefined | — |
gap | gap | Optional Nord spacing token between message rows. | ChatMessageListGap | undefined | — |
loading | loading | Whether older messages are currently loading. | boolean | false |
streaming | streaming | Whether assistant content is currently streaming. | boolean | false |
loadOlder | load-older | Enables the top-of-list load intent. | boolean | false |
Slots
| Slot name | Description |
|---|---|
Default slot | Chat messages and system messages in chronological DOM order. |
empty | Content shown only when the log has no messages. |
| Event | Detail Type | Description |
|---|---|---|
nord-load-more | ChatLoadMoreEvent | Requests messages older than the current first item. |
Dependencies
This component is internally dependent on the following components:
- <nord-spinner>
Spinner
Spinner component is used to indicate users that their action is being processed. You can customize the size and color of the spinner with the provided properties.
- <nord-visually-hidden>
VisuallyHidden
Visually hidden is used when an element needs to be available to assistive technologies like screen readers, but be otherwise hidden.