Skip to content

dannyblv/comments-section-react

Repository files navigation

A React component to render a comments section using commentssection.site. This component allows you to easily embed a comments thread in your React application.

Installation

Install the component via npm:

npm install comments-section-react

Or via Yarn:

yarn add comments-section-react

Usage

To use the CommentsSection component, you need to obtain a threadId from the commentssection.site dashboard. Follow these steps:

  1. Create a New Thread: Go to the commentssection.site dashboard and create a new thread.
  2. Get the threadId: After creating the thread, you will receive a threadId which you will use in the component.

Example

Here is an example of how to use the CommentsSection component in your React application:

import React from 'react';
import CommentsSection from 'comments-section-react';

const THREAD_ID = 'your-thread-id'; // Replace with your actual threadId

const App = () => (
  <div>
    <h1>Comments Section</h1>
    <CommentsSection threadId={THREAD_ID} />
  </div>
);

export default App;

You can also try a live example on CodeSandbox.
This sandbox also demonstrates how to override the component's styles via custom CSS.

Props

  • threadId (string): The ID of the thread. This ID is provided to you in the dashboard under the thread's section.

License

This project is licensed under the ISC License.

Support

For any questions or support, please contact support@commentssection.site. Opening a GitHub issue is also welcome. For more detailed information, you can refer to the documentation.