Thread list primitives for rendering conversation navigation, new thread actions, and custom assistant sidebars.
For examples and usage patterns, see ThreadList.
Anatomy
import { ThreadListPrimitive } from "@assistant-ui/react";
const ThreadList = () => (
<ThreadListPrimitive.Root>
<ThreadListPrimitive.New />
<ThreadListPrimitive.Items>
{() => <MyThreadListItem />}
</ThreadListPrimitive.Items>
</ThreadListPrimitive.Root>
);API Reference
Root
This primitive renders a <div> element unless asChild is set.
ThreadListPrimitiveRootPropsasChild: boolean= falseChange the default rendered element for the one passed as a child, merging their props and behavior.
Read the Composition guide for more details.render?: ReactElement
New
This primitive renders a <button> element unless asChild is set.
ThreadListPrimitiveNewPropsasChild: boolean= falseChange the default rendered element for the one passed as a child, merging their props and behavior.
Read the Composition guide for more details.render?: ReactElement
| Data attribute | Values |
|---|---|
[data-active] | Present when the new-thread button represents the current fresh thread. |
Items
ThreadListPrimitiveItemsPropsarchived?: booleancomponentsdeprecated?: ThreadListItemsComponentConfigDeprecated: Use the children render function instead.
ThreadListItem: ComponentType
children?: (value: { threadListItem: ThreadListItemState }) => ReactNodeRender function called for each thread list item. Receives the item.
ItemByIndex
Renders a single thread list item at the specified index.ThreadListPrimitiveItemByIndexPropsindex: numberarchived?: booleancomponents: ThreadListItemsComponentConfigThreadListItem: ComponentType
LoadMore
This primitive renders a <button> element unless asChild is set.
ThreadListPrimitiveLoadMorePropsasChild: boolean= falseChange the default rendered element for the one passed as a child, merging their props and behavior.
Read the Composition guide for more details.render?: ReactElement