Skip to content

MessageList

Stable

A column that holds a conversation and reads out new messages.

Also known as thread, chat thread, conversation, message thread

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

A short conversation

Summarise the meeting notes.
Assistant: The team agreed to ship on Friday and review metrics next week.

Your messages and the assistant's replies stack in one column.

When to use it

The column that holds one conversation. It reads new turns out to screen readers as they are added, so people who cannot see the screen can follow along.

Made of: Conversation area · Messages

Use it for

  • The messages of one conversation, in order.
  • A thread where replies arrive while the person waits.
  • A page with more than one conversation, each with its own name.

Not for

Do and avoid

When does my flight land?
Assistant: Your flight lands at 9:40. The hotel lets you check in from 2 pm.
Do. Turns sit in the list and the message box stays outside it.
When does my flight land?
Avoid. A message box inside the list gets read out to screen readers.

Do

  • Put each message directly inside it so each new one is read out.
  • Mark the reply as still being written while its words arrive.
  • Give each conversation its own name when a page shows more than one.
  • Place it inside ThreadTemplate, which already sets a good reading width.

Avoid

  • Do not put the message box inside it. Everything added there is read out.
  • Do not rebuild the list for every new word. Update the last message instead.
  • Do not add other read-out areas inside it.

On a phone

  • Fills the width of its container up to 768px, so on a phone it is the full width with a 24px gap between messages.
  • It does not scroll or pin itself. Your scrolling parent must handle the on-screen keyboard and the bottom safe area.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started