OfferLifetime Pro for $99

Comment Thread

A thread pinned to a clause or a cell: Enter sends, @ opens the people you can mention, your own comments can be edited or deleted, and resolving folds the thread to one line. CommentsPanel lists every thread with All, Open, Resolved and Mine.

The decision inside it

An agent's reply always says AI

A model's comment is marked AI next to its name, never only by its avatar, so people always know which replies a person wrote.

When to use it

Use Comment Thread for discussion pinned to one thing (a clause, a cell, a frame) with replies, @mentions and resolve. Use CommentsPanel beside a document to list every thread with Open, Resolved and Mine filters. For a chat between people and an agent, use the chat components.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Layro's Comment Thread for this.
Install it: npx shadcn@latest add @layro/comment-thread
(the @layro registry is set up in components.json, with LAYRO_KEY in .env.local)
Import it from @/components/ui/comment-thread.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @layro registry with your CLI token: see the Namespaced tab.

Usage

components/clause-comments.tsx
import { CommentThread, type Comment } from "@/components/ui/comment-thread";

export function ClauseComments({ comments, reply, resolve }: { comments: Comment[]; reply: (body: string) => void; resolve: (done: boolean) => void }) {
  return (
    <CommentThread
      anchor="Clause 4.2"
      comments={comments}
      currentUserId="michael"
      mentionable={[{ id: "olivia", name: "Olivia Martinez" }, { id: "sarah", name: "Sarah Anderson" }]}
      onReply={reply}
      onResolve={resolve}
    />
  );
}

API reference

“Copy prompt” above puts a full brief on your clipboard — install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

PropTypeNotes
commentsrequiredComment[]Oldest first. The first comment opens the thread.
resolvedbooleanFolded to the first comment with a "Resolved" summary.
mentionableMentionablePerson[]Who @ can mention.
currentUserIdstringYou, for Edit and Delete on your own comments.
anchorstringWhat the thread is attached to, shown above it ("Clause 4.2").
onReply(body: string) => voidSend a reply. Without it there is no reply box.
onResolve(resolved: boolean) => voidResolve (true) or reopen (false). Without it there is no Resolve button.
onEdit(id: string, body: string) => voidSave an edited comment.
onDelete(id: string) => voidDelete a comment.
lookLookLayered rests the thread in a tray with Resolve in the strip below. Default layered.
placeholderstringThe reply box's placeholder. Default "Reply…".

Dependencies

npm packages

clsxlucide-reacttailwind-merge

Layro foundations, installed alongside it

layro-themeavatar-stack

States

All of them are drawn by the component. None is left for you to design.

  • Open
  • Replying
  • Mentioning
  • Editing
  • Deleting
  • Resolved
  • Panel

Accessibility

  • Keyboard reachable throughout, in visual order
  • Focus trapped in overlays, Escape closes them
  • Focus returns to whatever opened it
  • Live regions announce what changed, not that something did
  • Honours prefers-reduced-motion

Responsive behavior

  • Sizes to its container, not the viewport
  • Usable from 320px up
  • Pointer-based interaction, so trackpad and touch both work
  • No hover-only affordances

Lifetime access

Every component, and everything we ship next.

  • All 232 components, source included
  • Every template, and everything released after you buy
  • shadcn CLI or download — React 18/19, Tailwind v4
  • One payment. No subscription.