# Thread bump

A chat list that shows activity as movement: a thread with a new reply rises to the top.

Also called: chat list animation, list reorder animation.

> chatcn Pro: needs a Pro license (https://chatcn.dev/pro). Install from the `@chatcn-pro` registry with your license token; setup at https://chatcn.dev/docs/chatcn-pro.

Example: Activity as movement. A thread with a new reply rises to the top of the list, gliding past the ones it overtakes, and arrives lit with its unread dot. Preview: https://chatcn.dev/preview/thread-bump-demo

When a thread gets a new reply it rises to the top, gliding past the threads it overtakes while they each step down one place, and arrives lit for a moment, its title heavier and its time in blue until it is read. Moves are animated from where each row was, so several bumps in a row never jump.

## Installation

```bash
npx shadcn@latest add @chatcn-pro/thread-bump
```

## Usage

```tsx
import { ThreadBump } from "@/components/ui/chatcn/pro/thread-bump"

<ThreadBump threads={byLatestActivity} activeId={current} onSelect={open} />
```

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `threads` | `{ id, title, preview?, time?, unread? }[]` | Newest activity first |
| `activeId` | `string` |  |
| `onSelect` | `(id) => void` |  |

## Accessibility

- A list of buttons; the current thread has `aria-current`; unread threads are labelled.

## Motion

- Rows move from their old place: 520 ms for the one that rose, 380 ms for the rest. Reduced motion: they swap.

Source: https://chatcn.dev/docs/components/thread-bump