ThreadList
A conversation's list. See the module docs.
packages/ui/src/components/patterns/messaging/thread-list.tsx
Import
Subpath export:
@marktiderman/genesis-ui/patternsimport { ThreadList } from "@marktiderman/genesis-ui/patterns";Components
Auto-generated from TypeScript source via
react-docgen-typescript.THREAD_AT_BOTTOM_PX
Pixels from the bottom that still count as "at the bottom".
No declared props.
ThreadList
A conversation's list. See the module docs.
| Prop | Type | Default | Description |
|---|---|---|---|
| data* | readonly T[] | — | Oldest first. |
| keyExtractor* | (row: T) => string | — | A row's id. It must stay the same across refreshes (from a cache to the server). |
| renderItem* | (row: T, info: ThreadRowInfo) => ReactNode | — | |
| announce | ((row: T) => string | null) | — | What a screen reader says when this row arrives at the bottom; null says nothing (your own message). |
| className | string | — | |
| conversationId | string | null | — | Which conversation this is. A new one opens at its newest row (or `openAt`), and the held place is forgotten. |
| earlierLabel | string | — | |
| empty | ReactNode | — | Shown instead of the rows when there are none. |
| footer | ReactNode | — | Under the last row: who is typing. |
| hasEarlier | boolean | — | There are earlier rows: loads them near the top, and shows the "Load earlier" button. |
| header | ReactNode | — | Above the first row, before the "Load earlier" button: what the thread is about. |
| jumpId | ((row: T) => string | null) | — | The id `jumpTo` names a row by, when it isn't the row's key: a message keyed by the id the client gave it and gone to by the server's id. `null` for a row that can't be gone to. `keyExtractor` by default. Pass a stable function (module scope, or `useCallback`). |
| jumpTo | string | null | — | Go to this row, loading earlier pages with `onLoadUntil` until it's here. A new id, or the same one after `null`, goes again. |
| label | string | — | The log region's name, for a screen reader. Default "Messages". |
| loading | boolean | — | The first page is loading: shows `loadingView` (a skeleton by default), and a jump waits. |
| loadingEarlier | boolean | — | |
| loadingView | ReactNode | — | |
| onAtBottomChange | ((atBottom: boolean) => void) | — | Whether the reader is at the bottom, as it changes (to show a "new messages" pill, say). |
| onJumpFailed | ((id: string) => void) | — | No row answers to this id once `onLoadUntil` has settled, or it failed. The reader stays where they are. |
| onLoadEarlier | (() => void) | — | |
| onLoadUntil | ((id: string) => Promise<boolean>) | — | Load earlier pages until the row is held; resolve false when it can't be found. |
| openAt | string | null | — | Open here instead of the newest row (the first unread), on first render and for each new `conversationId`. |
| ref | Ref<ThreadListHandle> | — | |
| renderEarlier | ((props: { loading: boolean; onPress: () => void; label: string; testID: string; }) => ReactNode) | — | Replaces the default "Load earlier" button. |
| testID | string | — |