Skip to main content

File Structure

When you install threaded comments, you get approximately 25 TypeScript/TSX files organized into a clear structure.

Directory Tree


Key Files

index.ts - Entry Point

Barrel export that makes imports clean:
Allows:
Instead of:

threaded-comment-section.tsx - Main Component

The entry component that orchestrates everything. Edit this to:
  • Add custom headers or footers
  • Modify the layout
  • Change the overall structure

new-comment-form.tsx - Comment Input

The textarea and submit button for top-level comments. Edit this to:
  • Customize placeholder text
  • Change button styles
  • Add character counters
  • Modify form behavior

single-comment.tsx - Individual Comment

The core comment display component. Edit this to:
  • Change author name styling
  • Modify comment body layout
  • Add custom badges or labels
  • Adjust spacing and padding

vote-buttons.tsx - Voting UI

Upvote and downvote buttons with score display. Edit this to:
  • Change button colors
  • Modify vote count formatting
  • Add animations
  • Change icon styles

Common Customizations

Change Colors

Inline Styles Variant: Open any component file. Look for the color palette guide in the header:
Find and replace hex codes throughout the file. Tailwind Variant: Edit tailwind.config.js or change classes directly in files:

Modify Layout

Open threaded-comment-section.tsx and rearrange JSX:

Remove Features

Don’t want vote buttons? Just comment them out or delete:

File Responsibilities


Import Patterns

Files use relative imports internally:
The CLI handles import transformations during installation, so everything works out of the box.

Next Steps

Props & API

Component props reference

Customization

Customize colors, layout, functionality

Features

Explore all features

Installation

Installation guide