Timeline
Follow what happened, newest first, grouped by day.
Threaded comments with replies, reactions, mentions, inline edit, and resolve.
npx shadcn@latest add @silicon-ui/comment-threadnpx shadcn@latest add @silicon-ui/comment-threadInstall the dependencies.
npm install lucide-react motionCopy these files into your project. Shared files are skipped if you already have them.
components/silicon-ui/comment-thread/comment-thread.tsxcomponents/silicon-ui/comment-thread/comment-thread.module.cssInstall the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation
| Prop | Type | Default |
|---|---|---|
currentUser*The person writing. Their comments can be edited and deleted. | CommentAuthor | — |
comments | ThreadComment[] | — |
defaultComments | ThreadComment[] | [] |
onCommentsChange | (comments: ThreadComment[], event: CommentThreadEvent) => void | — |
peoplePeople who can be mentioned. Defaults to everyone in the thread. | CommentAuthor[] | — |
resolved | boolean | — |
defaultResolved | boolean | false |
onResolvedChange | (resolved: boolean) => void | — |
titleWhat the thread is about, shown in its header, such as "Hero headline". | ReactNode | — |
reactionsEmoji offered by the reaction picker. | string[] | DEFAULT_REACTIONS |
placeholder | string | "Reply, or @mention someone" |
maxDepthReplies deeper than this attach to the deepest allowed parent. Defaults to 2. | number | 2 |
nowLabelLabel for comments written now. | string | "Just now" |
labelsWords for localization. Leave out any key to keep its English default. | CommentThreadLabels | — |
className | string | — |
Also accepts the props of HTMLAttributes.