Componentmedia0.5 KB gzipZero dependencies

CommentThread

Nested comments with avatars, collapse/reply actions, and dashed indent guides.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add comment-thread

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { CommentThread } from "@/components/ui/comment-thread"; <CommentThread comments={comments} maxDepth={3} />

Source code

comment-thread.tsx + 1 helper

Zero 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 />
PropTypeDescription
commentsCommentNode[]Configures comments. (Default: [])
maxDepthnumberConfigures max depth. (Default: 3)