Genesis
@beta

ThreadPage

ThreadPage — one conversation on the web: messages oldest first, a composer at the bottom, attachments, a read receipt, earlier pages, going to a message, the first unread, events between messages, and send states. The web twin of ui-native's `ThreadPage`, with the same props and slots, on the shared conversation contract (`@marktiderman/genesis-core/conversation`): the same `ThreadMessage[]` and `ThreadComposer` render on both. Built from the web atoms `ThreadList` and `ComposerBar`, so an app can take this whole or build its own thread from the same parts. It fills its container (a flex column of full height): put it in a page, a pane of `InboxLayout`, or the chat dock. Mine are on the trailing side in `primary`, theirs on the leading side on `muted`; an internal note (`tone: "internal"`) is edged in `warning` and says so to a screen reader. Data: rows arrive as props and the page never fetches. A row's send state is data (`sending`, `pending`, `paused`, `failed`, `conflict`) with `onRetry` / `onDiscard`. Read-only: `composer={null}`, with an optional `closedNotice`. Slots: `message`, `event`, `attachment`, `readReceipt`, `unreadDivider`, `composer`, `composerAccessory`, `headerRegion` (pinned above the list), `header` (scrolls above the first message), `earlier` and `empty`. Tailwind has to see this package's classes: import `@marktiderman/genesis-ui/styles.css`, or add `@source "../node_modules/@marktiderman/genesis-ui/dist";` to your CSS.

packages/ui/src/components/patterns/messaging/thread-page.tsx

Import
Subpath export: @marktiderman/genesis-ui/patterns
import { ThreadPage } from "@marktiderman/genesis-ui/patterns";
Components
Auto-generated from TypeScript source via react-docgen-typescript.

ThreadPage

PropTypeDefaultDescription
composer*ThreadComposer | null—`null`: read-only, no composer.
messages*ThreadMessage[]—Oldest first.
classNamestring—
closedNoticestring—Shown instead of the composer when it is `null` ("This conversation is closed").
conversationIdstring | null—Which conversation this is. When it changes (another row picked in an inbox), the thread opens afresh: at the first unread, or the newest.
earlierLabelstringLoad earlier messages
emptyBodystring—
emptyTitlestring—
errorbooleanfalseThe read failed and there are no messages: the empty slot shows `errorTitle` / `errorBody` instead.
errorBodystringCheck your connection and try again.
errorTitlestringCouldn't load this conversation
firstUnreadIdstring | null—The first message the reader hasn't seen: a "New messages" divider above it.
formatTime((date: Date) => string)—
hasEarlierbooleanfalseThere are older messages: they load near the top, and a "load earlier" button shows.
headerReactNode—Above the first message, scrolling with them. Prefer `slots.header` for a component.
jumpTostring | null—Go to this message, loading with `onLoadUntil` until it's here.
labelsPartial<ThreadLabels>—The words the defaults say, for translating.
loadingbooleanfalseThe first page is loading: a skeleton instead of the empty state, and a jump waits for it.
loadingEarlierbooleanfalse
onJumpFailed((id: string) => void)—A `jumpTo` message couldn't be found (the reader stays where they are). Default: a screen reader hears `labels.messageGone`.
onLoadEarlier(() => void)—
onLoadUntil((id: string) => Promise<boolean>)—
onRetry(() => void)—A "Try again" button with `error`.
readAtstring | Date | null—When the other side last read the thread: my newest message sent before it shows the read receipt.
readLabelstringRead
retryLabelstringTry again
sendOnenum—Which key sends. Default `enter` (Shift+Enter for a new line). Native ignores it.
slotPropsSlotPropsFor<ThreadPageSlotMap>{}
slotsSlots<ThreadPageSlotMap>{}
testIDstringthread-pagetestID on the root. Default `"thread-page"`.
updatingbooleanfalseFresher rows are on their way (the cache showed first): a quiet "Updating…" line.