Can we say "per seat" instead of "per user"?
Comments
Threads for tasks, documents, deals and posts: replies, likes, @mentions and a box that grows as you write. Add data-momo-comments to a section.comments and tell it who is writing with data-me.
Thread
Click Reply under any comment, write, and press Ctrl + Enter (⌘ + Enter on a Mac). Type @ to mention someone from the list. Threads with two or more replies get a Hide replies button.
Comments 3
<section class="comments" data-momo-comments data-me="Henry Richardson" data-me-initials="HR" data-me-color="violet" data-people="cm-people" aria-labelledby="cm-title">
<div class="comments-head">
<h3 class="comments-title" id="cm-title">Comments <span class="badge badge-pill" data-momo-comments-count>3</span></h3>
</div>
<ol class="comment-list">
<li class="comment" id="cm-1">
<span class="avatar bg-cyan" aria-hidden="true">SW</span>
<article class="comment-main">
<header class="comment-head"><b class="comment-author">Sallie Wade</b><span class="badge badge-sm">Owner</span><time class="comment-time" datetime="2026-11-29T09:12">2 h ago</time></header>
<div class="comment-body"><p>The new pricing page is up on staging. <span class="mention">@Lucy Fox</span> can you check the plan table on phones?</p></div>
<div class="comment-actions">
<button class="comment-action" type="button" data-momo-like aria-pressed="false"><i class="mi mi-thumbs-up" aria-hidden="true"></i><span class="comment-count">2</span><span class="visually-hidden">Like</span></button>
<button class="comment-action" type="button" data-momo-reply><i class="mi mi-reply" aria-hidden="true"></i>Reply</button>
</div>
<ol class="comment-replies">
<li class="comment" id="cm-2">
<span class="avatar bg-orange" aria-hidden="true">LF</span>
<article class="comment-main">
<header class="comment-head"><b class="comment-author">Lucy Fox</b><time class="comment-time" datetime="2026-11-29T10:02">1 h ago</time></header>
<div class="comment-body"><p>Checked on two phones. The yearly toggle wraps under the price, otherwise good.</p></div>
<div class="comment-actions">
<button class="comment-action" type="button" data-momo-like aria-pressed="true"><i class="mi mi-thumbs-up-filled" aria-hidden="true"></i><span class="comment-count">1</span><span class="visually-hidden">Like</span></button>
<button class="comment-action" type="button" data-momo-reply><i class="mi mi-reply" aria-hidden="true"></i>Reply</button>
</div>
</article>
</li>
<li class="comment" id="cm-3">
<span class="avatar bg-cyan" aria-hidden="true">SW</span>
<article class="comment-main">
<header class="comment-head"><b class="comment-author">Sallie Wade</b><time class="comment-time" datetime="2026-11-29T10:20">45 min ago</time><span class="comment-edited">(edited)</span></header>
<div class="comment-body"><p>Fixed, thanks! <span class="mention mention-me">@Henry Richardson</span> ready for your review.</p></div>
<div class="comment-actions">
<button class="comment-action" type="button" data-momo-like aria-pressed="false"><i class="mi mi-thumbs-up" aria-hidden="true"></i><span class="comment-count"></span><span class="visually-hidden">Like</span></button>
<button class="comment-action" type="button" data-momo-reply><i class="mi mi-reply" aria-hidden="true"></i>Reply</button>
</div>
</article>
</li>
</ol>
</article>
</li>
</ol>
<form class="comment-form"></form>
<datalist id="cm-people">
<option value="Sallie Wade" label="Design lead" data-initials="SW" data-color="cyan"></option>
<option value="Lucy Fox" label="Frontend" data-initials="LF" data-color="orange"></option>
<option value="Eula Horton" label="Product" data-initials="EH" data-color="pink"></option>
<option value="Ina Hogan" label="Support" data-initials="IH" data-color="yellow"></option>
<option value="Henry Richardson" label="You" data-initials="HR" data-color="violet"></option>
</datalist>
</section>An empty <form class="comment-form"> is filled in for you (your avatar, the box, the buttons). Write your own form instead to change the text or add buttons: keep a textarea.comment-input in it.
Parts
| Class | Is |
|---|---|
.comment | One comment (li): an avatar and a .comment-main |
.comment-head | .comment-author, any badge, time.comment-time (can be a link to the comment), .comment-edited |
.comment-body | The text. .mention marks a name, .mention-me marks you. |
.comment-actions | .comment-action buttons: data-momo-like (with a .comment-count), data-momo-reply, or your own |
.comment-replies | The thread under a comment. Replies to replies stay in the same thread and start with an @mention. |
[data-momo-comments-count] | Shows how many comments there are, kept up to date |
Boxed and states
.comments-cards puts each comment in a bordered card, for a feed or a sidebar. .is-resolved grays a settled comment, .is-highlight (or opening a link to the comment's id) marks one in yellow, .is-pending fades one while it is being saved.
-
Eula HortonResolved -
Ina Hogan Three customers asked about the annual discount today.
Is the 20% off still on for teams?
<section class="comments comments-cards" data-momo-comments data-me="Henry Richardson" data-me-initials="HR" data-me-color="violet" aria-label="Review notes">
<ol class="comment-list">
<li class="comment is-resolved">
<span class="avatar bg-pink" aria-hidden="true">EH</span>
<article class="comment-main">
<header class="comment-head"><b class="comment-author">Eula Horton</b><time class="comment-time">Yesterday</time><span class="comment-resolved"><i class="mi mi-circle-check" aria-hidden="true"></i>Resolved</span></header>
<div class="comment-body"><p>Can we say "per seat" instead of "per user"?</p></div>
</article>
</li>
<li class="comment is-highlight">
<span class="avatar bg-yellow" aria-hidden="true">IH</span>
<article class="comment-main">
<header class="comment-head"><b class="comment-author">Ina Hogan</b><time class="comment-time">10 min ago</time></header>
<div class="comment-body"><p>Three customers asked about the annual discount today.</p><blockquote>Is the 20% off still on for teams?</blockquote></div>
<div class="comment-actions">
<button class="comment-action" type="button" data-momo-like aria-pressed="false"><i class="mi mi-thumbs-up" aria-hidden="true"></i><span class="comment-count">4</span><span class="visually-hidden">Like</span></button>
<button class="comment-action" type="button" data-momo-reply><i class="mi mi-reply" aria-hidden="true"></i>Reply</button>
</div>
</article>
</li>
</ol>
</section>Saving comments
Before a comment is added, the section fires momo:comment with detail.text and detail.parent (the id of the top comment, or null). Momo adds it right away as "Just now". To save it first, call preventDefault() and add it yourself once your server answers. Likes fire momo:like.
const thread = document.querySelector('.comments');
thread.addEventListener('momo:comment', async (e) => {
e.preventDefault();
const saved = await fetch('/api/comments', { method: 'POST', body: JSON.stringify(e.detail) }).then((r) => r.json());
Momo.comments.add(thread, { id: saved.id, name: 'Henry Richardson', initials: 'HR', color: 'violet', text: saved.text, parent: e.detail.parent });
});
Momo.comments.remove('cm-3');
Text is always added as plain text (never as HTML). Blank lines start a new paragraph and @Name becomes a mention when the name is in the data-people list.
Accessibility
- The thread is a list; each comment is an article named by its author.
- Every box has its own name ("Reply to Lucy Fox"). Esc closes a reply box and puts you back on its Reply button.
- The like button says "Like" and shows its state with
aria-pressed. - Posting is read out ("Reply posted"). The @ list works with the arrow keys, Enter or Tab to pick and Esc to close.
The new pricing page is up on staging. @Lucy Fox can you check the plan table on phones?
Checked on two phones. The yearly toggle wraps under the price, otherwise good.
Fixed, thanks! @Henry Richardson ready for your review.