Chords
Chords
Major Chords

ThreadList & ThreadListItem

Sidebar thread list with "New Thread" button, loading skeletons, and per-item context menus.

Overview

ThreadList renders a sidebar of conversation threads with a "New Thread" button and loading skeletons. ThreadListItem renders each thread with a title, active state highlighting, and a context menu with archive/delete actions.

Demo

When to use

  • Build a sidebar showing all conversation threads
  • Provide "New Thread", archive, and delete actions
  • Show loading skeletons during thread list fetch

Features

  • Loading state: Automatic skeleton rows while threads load via AuiIf
  • Config-driven actions: Choose which actions appear in the context menu (archive, delete, unarchive)
  • Active state: Current thread is highlighted via data-[active]
  • Composable: Use ThreadListItem standalone or pass a custom component to ThreadList

ThreadList Props

PropTypeDefaultDescription
classNamestringRoot list container class
newThreadLabelstring"New Thread"Button label
newThreadClassNamestringNew thread button class
newThreadIconReactNodeplus SVGCustom icon
skeletonCountnumber5Number of skeleton rows
skeletonClassNamestringSkeleton bar class
renderSkeleton() => ReactNodeCustom skeleton renderer
renderNewThread() => ReactNodeCustom new thread button
ThreadListItemComponentTypeCustom thread list item component

ThreadListItem Props

PropTypeDefaultDescription
classNamestringItem root class
triggerClassNamestringClickable area class
titleClassNamestringTitle text class
titleFallbackstring"New Chat"Fallback when thread has no title
actionsThreadListAction[]["archive", "delete"]Actions in the context menu
moreButtonClassNamestringMore button class
menuClassNamestringDropdown menu class
menuItemClassNamestringMenu item class
renderTitle() => ReactNodeCustom title renderer
renderMore() => ReactNodeCustom context menu renderer

Basic Usage

import { ThreadList, ThreadListItem } from "@assistant-ui/chords";

<ThreadList
  ThreadListItem={() => (
    <ThreadListItem actions={["archive", "delete"]} />
  )}
/>

With Unarchive

<ThreadListItem actions={["unarchive", "delete"]} />

Underlying Primitives

ThreadList wraps:

  • ThreadListPrimitive.Root — list container
  • ThreadListPrimitive.New — new thread button
  • ThreadListPrimitive.Items — renders thread items
  • AuiIf — conditional rendering for loading/loaded states

ThreadListItem wraps:

  • ThreadListItemPrimitive.Root — item container with data-[active]
  • ThreadListItemPrimitive.Trigger — clickable area to switch threads
  • ThreadListItemPrimitive.Title — thread title with fallback
  • ThreadListItemPrimitive.Archive / .Unarchive / .Delete — action buttons
  • ThreadListItemMorePrimitive — context menu (.Root, .Trigger, .Content, .Item)

On this page