logoassistant-ui
API ReferenceRadix UI Primitives

ThreadListPrimitive

Displays a list of conversation threads.

Anatomy

import { ThreadListPrimitive } from "@assistant-ui/react";

const ThreadList = () => (
  <ThreadListPrimitive.Root>
    <ThreadListPrimitive.New />
    <ThreadListPrimitive.Items
      components={{
        ThreadListItem: MyThreadListItem
      }}
    />
  </ThreadListPrimitive.Root>
);

API Reference

Root

Contains all parts of the thread list.

This primitive renders a <div> element unless asChild is set.

ThreadListPrimitiveRootProps

asChild:

boolean = false

Change the default rendered element for the one passed as a child, merging their props and behavior.

Read the Composition guide for more details.

New

A button to create a new thread.

This primitive renders a <button> element unless asChild is set.

ThreadListPrimitiveNewProps

asChild:

boolean = false

Change the default rendered element for the one passed as a child, merging their props and behavior.

Read the Composition guide for more details.

Items

Renders all items in the thread list.

ThreadListPrimitive.Items.Props

archived:

boolean = false

Whether to show archived threads instead of active threads.

components:

ThreadListItemComponents

The components to render for each thread list item.

ThreadListItemComponents

ThreadListItem:

ComponentType

The component to render for each thread in the list.

ItemByIndex

Renders a single thread list item at the specified index.

<ThreadListPrimitive.ItemByIndex
  index={0}
  components={{
    ThreadListItem: MyThreadListItem
  }}
/>

ThreadListPrimitive.ItemByIndex.Props

index:

number

The index of the thread list item to render.

archived:

boolean = false

Whether to render from archived threads instead of active threads.

components:

ThreadListItemComponents

The components to render for the thread list item.