Skip to main content

Installing Threaded Comments

Add Reddit-style threaded comments to your project with a single command.

Prerequisites

1

Initialize CLI

Creates your sublay.json configuration file.
2

Install Dependencies

React (Web):
React Native:
Expo:
See the CLI Setup Guide for details.

Installation Command


What Gets Installed

The CLI will:
  1. Fetch the component from the registry based on your sublay.json platform and style settings
  2. Copy ~25 files into your project at {componentsPath}/comments-threaded/
  3. Transform imports to work with your project structure
  4. Create index.ts barrel export for clean imports
  5. Display usage examples and required dependencies

File Structure Created


Using the Component

After installation, import and use the component:
Make sure your app is wrapped with <SublayProvider>. See the Quick Start Guide for setup details.

Switching Styling Variants

To switch between Tailwind and Inline Styles after installation:
1

Delete Current Components

2

Update Configuration

Edit sublay.json:
3

Re-install

This replaces your component files. Back up any customizations first.

Troubleshooting

Make sure your import path matches your paths.components in sublay.json:
Ensure your tsconfig.json includes the components directory:
Re-running add overwrites the existing installation. The CLI prints a warning first, then proceeds:
Because these files are yours to edit, any customizations you made are replaced. Commit (or back up) your changes before re-adding a component:

Next Steps

Props & API

Learn about available props

File Structure

Understand the component organization

Customization

Customize colors, layout, and functionality

Features

Explore all features