Chat Message
Real-world assistant, outgoing, research and agent message compositions built with c2-chat-message.
Each card treats the message as part of a believable conversation. The examples stay full-width so typography and long-form content have room to breathe.
I’ve reviewed the latest prototype.
The new hierarchy is easier to scan, especially around the primary action.
I’ve reviewed the latest prototype.
The new hierarchy is easier to scan, especially around the primary action.
<style>
.default-message-stage {
box-sizing: border-box;
width: min(100%, 720px);
padding: 30px;
border: 1px solid var(--c2-theme--color-outline-variant, #e4e4e7);
border-radius: 24px;
background: var(--c2-theme--color-surface, #ffffff);
color: color-mix(in srgb, var(--c2-theme--color-on-surface, #18181b) 93%, var(--c2-theme--color-surface, #ffffff));
font-family: Inter, system-ui, sans-serif;
}
.default-message-copy {
display: grid;
gap: 8px;
}
.default-message-copy p {
margin: 0;
}
</style>
<section class="default-message-stage">
<c2-chat-message client:load>
<c2-avatar client:load auto-color name="Maya Chen" initial-count="2" slot="avatar"></c2-avatar>
<span slot="title">Maya</span>
<time slot="header-time">A moment ago</time>
<div class="default-message-copy">
<p>I’ve reviewed the latest prototype.</p>
<p>The new hierarchy is easier to scan, especially around the primary action.</p>
</div>
</c2-chat-message>
</section>The strongest version keeps the interaction focused on one decision at a time.
- Lead with the recommended action.
- Reveal advanced options only when they become relevant.
- Keep status feedback close to the control that caused it.
The strongest version keeps the interaction focused on one decision at a time.
- Lead with the recommended action.
- Reveal advanced options only when they become relevant.
- Keep status feedback close to the control that caused it.
<style>
.answer-stage {
box-sizing: border-box;
width: min(100%, 720px);
padding: 30px;
border: 1px solid var(--c2-theme--color-outline-variant, #e4e4e7);
border-radius: 24px;
background: linear-gradient(145deg, var(--c2-theme--color-surface, #ffffff), color-mix(in srgb, var(--c2-theme--color-on-surface, #18181b) 3%, var(--c2-theme--color-surface, #ffffff)));
color: color-mix(in srgb, var(--c2-theme--color-on-surface, #18181b) 93%, var(--c2-theme--color-surface, #ffffff));
font-family: Inter, system-ui, sans-serif;
}
.answer-message {
--c2-chat-message__message--max-width: 38rem;
--c2-chat-message__message--gap: 9px;
--c2-chat-message--line-height: 1.65;
}
.answer-avatar {
--c2-avatar--size: 36px;
--c2-avatar--background: var(--c2-theme--color-dark-surface, #18181b);
}
.answer-copy {
display: grid;
gap: 12px;
}
.answer-copy p {
margin: 0;
}
.answer-copy ul {
display: grid;
gap: 6px;
margin: 0;
padding-left: 20px;
}
.answer-actions {
display: flex;
gap: 2px;
margin-left: -7px;
}
.answer-action {
--c2-icon-button__state-layer--size: 30px;
--c2-icon-button__icon--width: 15px;
--c2-icon-button__icon--height: 15px;
--c2-icon-button__icon--color: var(--c2-theme--color-on-surface-variant, #71717a);
--c2-icon-button__hover--background-color: color-mix(in srgb, var(--c2-theme--color-on-surface, #18181b) 7%, var(--c2-theme--color-surface, #ffffff));
}
</style>
<section class="answer-stage">
<c2-chat-message class="answer-message" client:load>
<c2-avatar class="answer-avatar" client:load name="Nova AI" initials="AI" slot="avatar"></c2-avatar>
<span slot="title">Nova</span>
<time slot="header-time">Just now</time>
<div class="answer-copy">
<p>The strongest version keeps the interaction focused on one decision at a time.</p>
<ul>
<li>Lead with the recommended action.</li>
<li>Reveal advanced options only when they become relevant.</li>
<li>Keep status feedback close to the control that caused it.</li>
</ul>
</div>
<div class="answer-actions" slot="emotion">
<c2-icon-button class="answer-action" client:load tooltip="Copy answer"><c2-feather-copy></c2-feather-copy></c2-icon-button>
<c2-icon-button class="answer-action" client:load tooltip="Good answer"><c2-feather-thumbs-up></c2-feather-thumbs-up></c2-icon-button>
<c2-icon-button class="answer-action" client:load tooltip="Try again"><c2-feather-rotate-ccw></c2-feather-rotate-ccw></c2-icon-button>
</div>
</c2-chat-message>
</section>Compare the two onboarding directions and recommend the calmer one.
YouDeliveredCompare the two onboarding directions and recommend the calmer one.
YouDelivered<style>
.outgoing-stage {
box-sizing: border-box;
width: min(100%, 720px);
padding: 30px;
border-radius: 24px;
background: var(--c2-theme--color-surface-container, #f4f4f5);
font-family: Inter, system-ui, sans-serif;
}
.outgoing-message {
--c2-chat-message--gap: 10px;
--c2-chat-message__message--max-width: min(30rem, 78%);
--c2-chat-message__message--gap: 5px;
--c2-chat-message__message--padding-top: 10px;
--c2-chat-message__message--padding-right: 14px;
--c2-chat-message__message--padding-bottom: 10px;
--c2-chat-message__message--padding-left: 14px;
--c2-chat-message__message--border-top-left-radius: 18px;
--c2-chat-message__message--border-top-right-radius: 5px;
--c2-chat-message__message--border-bottom-left-radius: 18px;
--c2-chat-message__message--border-bottom-right-radius: 18px;
--c2-chat-message__message--background: var(--c2-theme--color-dark-surface, #18181b);
--c2-chat-message__message--color: var(--c2-theme--color-on-dark-surface, #fafafa);
--c2-chat-message__header__title--color: color-mix(in srgb, var(--c2-theme--color-on-dark-surface, #fafafa) 83%, var(--c2-theme--color-dark-surface, #18181b));
--c2-chat-message__time--color: var(--c2-theme--color-on-dark-surface-variant, #a1a1aa);
}
.outgoing-message p {
margin: 0;
color: inherit;
}
</style>
<section class="outgoing-stage">
<c2-chat-message class="outgoing-message" client:load align="right">
<span slot="title">You</span>
<time slot="header-time">2:42 PM</time>
<p>Compare the two onboarding directions and recommend the calmer one.</p>
<span slot="footer-time">Delivered</span>
</c2-chat-message>
</section>Retention improved most when teams shortened setup and delayed optional personalization until after the first successful outcome.
Retention improved most when teams shortened setup and delayed optional personalization until after the first successful outcome.
<style>
.research-message-stage {
box-sizing: border-box;
width: min(100%, 720px);
padding: 30px;
border: 1px solid light-dark(#e8e1d5, #3a3329);
border-radius: 24px;
background: color-mix(in srgb, var(--c2-theme--color-on-surface, #18181b) 5%, var(--c2-theme--color-surface, #ffffff));
color: color-mix(in srgb, var(--c2-theme--color-on-surface, #18181b) 92%, var(--c2-theme--color-surface, #ffffff));
font-family: Georgia, serif;
}
.research-message {
--c2-chat-message--gap: 13px;
--c2-chat-message__message--max-width: 39rem;
--c2-chat-message--font-family: Georgia, serif;
--c2-chat-message--font-size: 15px;
--c2-chat-message--line-height: 1.7;
--c2-chat-message__header__title--color: color-mix(in srgb, var(--c2-theme--color-on-surface, #18181b) 92%, var(--c2-theme--color-surface, #ffffff));
--c2-chat-message__time--color: color-mix(in srgb, #8a7d6b 75%, var(--c2-theme--color-on-surface, #18181b));
}
.research-message-avatar {
--c2-avatar--size: 36px;
--c2-avatar--background: #7c5c3e;
}
.research-message-copy {
display: grid;
gap: 12px;
}
.research-message-copy p {
margin: 0;
}
.research-sources {
display: flex;
flex-wrap: wrap;
gap: 7px;
}
.research-source {
padding: 5px 9px;
border: 1px solid color-mix(in srgb, #7c5c3e 25%, var(--c2-theme--color-surface, #ffffff));
border-radius: 999px;
background: color-mix(in srgb, var(--c2-theme--color-surface, #ffffff) 58%, transparent);
color: color-mix(in srgb, #7c5c3e 70%, var(--c2-theme--color-on-surface, #18181b));
font: 600 11px/1.2 Inter, system-ui, sans-serif;
text-decoration: none;
}
</style>
<section class="research-message-stage">
<c2-chat-message class="research-message" client:load>
<c2-avatar class="research-message-avatar" client:load name="Research assistant" initials="R" slot="avatar"></c2-avatar>
<span slot="title">Research assistant</span>
<time slot="header-time">3 sources</time>
<div class="research-message-copy">
<p>Retention improved most when teams shortened setup and delayed optional personalization until after the first successful outcome.</p>
<div class="research-sources">
<a class="research-source" href="#source-1">1 · Product report</a>
<a class="research-source" href="#source-2">2 · User interviews</a>
<a class="research-source" href="#source-3">3 · Cohort analysis</a>
</div>
</div>
</c2-chat-message>
</section>