Skip to content

Message

Stable

One turn in a conversation: a bubble for the person, open text across the full width for the assistant.

Also known as chat bubble, chat message, response, turn

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

User and assistant

Can you summarize the meeting?
Assistant:

The team agreed to ship on Friday and review the open risks on Wednesday.

The person's bubble never fills the whole width. The assistant has no bubble.

When to use it

One turn in a chat. The person's words sit in a bubble on the right; the assistant's reply is open text across the full width, so long answers and code have room.

Made of: Mark and name (optional, above) · Bubble or plain text · Blinking cursor · Bottom area

Use it for

  • Each turn of a conversation, from the person or the assistant.
  • A reply that is still being written: turn on streaming.
  • A finished reply with actions, feedback or sources underneath.

Not for

  • A whole conversation that should be read out as it grows: use MessageList.
  • Notes from the app itself, such as limits or errors: use Callout.
  • A refusal or a safety stop: use RefusalNotice.

Do and avoid

Assistant: Your invoice is due on the 12th. I can remind you on the 10th.
Do. Short, plain answer with the next step included.
ASSISTANT: Per the aforementioned invoice documentation, remittance obligations accrue pursuant to the stated terms, whereupon…
Avoid. A wall of stiff wording is hard to read in a chat.

Do

  • Keep the assistant's text out of a bubble so long text and code have room.
  • Put actions and feedback at the bottom, and only after the reply ends.
  • Wrap the messages in an area that announces new replies if your app should read them out.
  • Show the AI mark once, on the first reply, or not at all. The thread already says who is speaking.

Avoid

  • Do not put the assistant's text in a bubble. The layout needs it open.
  • Do not put a mark beside every reply. It pushes the text in and fills the thread with repeated marks.
  • Do not add a bottom area to a person's message. It is ignored.
  • Remember to mark the reply as finished, or the blinking cursor stays.

On a phone

  • The user bubble is at most 80% of the width, and the assistant text takes the full width.
  • The assistant text can shrink to the width of the screen and wraps. Wide children such as tables or code must scroll inside themselves.

Build your next AI screen with Tattva.

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

Get started