Display all the threads in a given location
The ThreadList
component renders the list of threads created with a given location (see the location
property in the Thread
component). It provides a quick way for users to view multiple conversations.
This component pairs well with:
import { ThreadList } from "@cord-sdk/react";
export const Example = () => {
return (
<ThreadList
location={{ "page": "index" }}
onThreadClick={(threadId, threadSummary) =>
console.log("user clicked on thread:", threadId, threadSummary)
}
style={{ width: "300px" }}
/>
);
};
true
.false
, when the thread list has no threads, it will show a completely empty container. If set to true
, it will instead show a placeholder, containing a description of the types of threads a user will see.true
.true
.
If highlightThreadId
is passed in, it will disable
highlightOpenFloatingThread
.highlightThreadId
is used,
it will disable highlightOpenFloatingThread
.ThreadList
.This is an object with the following fields:
Show property details
false
, only threads that exactly match the provided location are shown. If true
, threads in any partially matching location are also shown.false
.onRender
to determine when loading is complete.onLoading
to determine when a component begins loading.mouseenter
event.
The callback is passed two arguments: the threadID of the thread and an object of type {thread: ThreadSummary}
containing the thread summary.
For example, you could use this event to highlight the section of a webpage being discussed in the hovered thread.{thread: ThreadSummary}
containing the thread summary.
For example, you could use this event to terminate the special behavior initiated with onThreadMouseEnter
.resolved
event.
The callback is passed an object of type {threadID: string; thread: ThreadSummary}
containing the thread's ID and summary.
For example, you could use this event to remove the visibility of a thread when it's marked as resolved{threadID: string; thread: ThreadSummary}
containing the thread's ID and summary.
For example, you could use this event to terminate the special behavior initiated with onThreadResolve
.Not finding the answer you need? Ask our Developer Community