Componentmedia0.5 KB gzipZero dependencies
CommentThread
Nested comments with avatars, collapse/reply actions, and dashed indent guides.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add comment-threadOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { CommentThread } from "@/components/ui/comment-thread"; <CommentThread comments={comments} maxDepth={3} />Source code
comment-thread.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxcomment-thread.tsx81 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface CommentNode { id: string; author: string; initials: string; body: string; time?: string; children?: CommentNode[];} export interface CommentThreadProps { comments: CommentNode[]; maxDepth?: number;}Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { CommentThread } from "@/components/ui/comment-thread"; <CommentThread />| Prop | Type | Description |
|---|---|---|
| comments | CommentNode[] | Configures comments. (Default: []) |
| maxDepth | number | Configures max depth. (Default: 3) |