Components, Chat
Message
One message in a conversation. Yours sits on a soft surface, the agent's is plain body text.
Draft replies to last week's customer inquiry emails. I'll handle the refund requests myself.
RiRia
I found 12 customer inquiries from last week in your inbox. I'm leaving out the 3 refund requests and drafting replies to the other 9.
One message in a conversation. Your message sits on the right on a soft surface. The agent’s message is set as body text with no surface. The preview here is static. Props and accessibility behavior are settled at implementation time.
Anatomy
| Part | Appearance |
|---|---|
| Your message | Right aligned. accent surface, 16px corner radius (4px on the bottom right only), 10px by 14px padding, 16px text with a 1.6 line height. Maximum width 480px |
| Agent’s message | No surface. A name line (avatar sm and the name at 14px, weight 600), then body text at 16px with a 1.7 line height, at most 60 characters wide |
| Between messages | 20px |
- The agent’s message has no surface because it is long and it holds tables, code and step lists.
- In a room where several agents speak, the name line tells you who spoke. Bubble color does not.
- The Markdown primitive draws the body.
Markup
<div class="Message_thread">
<div class="Message_me">Draft replies to last week's customer inquiry emails.</div>
<div class="Message_agent">
<div class="Message_by"><span class="Avatar_avatar Avatar_avatar--sm">Ri</span>Ria</div>
<p class="Message_body">I found 12 customer inquiries from last week in your inbox.</p>
</div>
</div>
Don’t
- Don’t give each agent a different bubble color.
- Don’t use the
primaryfill for your message.