Genesis
@beta

InboxPage

InboxPage — a list of conversations on the web: rows with an unread dot or count, a short time (`9:41`, `Yesterday`, a weekday, a date), a two-line preview and a status line, paging, and loading, error and empty states. The web twin of ui-native's `InboxPage`, with the same props and slots, on the shared conversation contract (`@marktiderman/genesis-core/conversation`): the same `InboxItem[]` renders on both. Each row's `swipeActions` (a swipe on the phone) are a "More" menu on the row here, so they're always reachable by mouse, keyboard and screen reader. A `selected` row is the conversation open beside the list (`InboxLayout`), marked `aria-current`. Keyboard: the rows are one tab stop, which stays on the row you were last on; Up and Down (or j and k) move between rows, Home and End go to the first and last, Enter opens one, and Right reaches a row's "More" menu (Left comes back). Anything the app puts in a row's `trailing` is its own tab stop. A custom `row` slot spreads `rowProps` on its focusable element to keep this. Slots: `row`, `header` (above the list), `footer` (below it), `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/inbox-page.tsx

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

InboxPage

PropTypeDefaultDescription
items*InboxItem[]—Newest first, as they should show. Empty → the empty state.
checkedReadonlySet<string>—Picked rows, for a bulk action: each row gets a checkbox (its own tab stop). Shift on a checkbox reports `shiftKey`, so the app can pick a range.
checkLabel((title: string) => string)(title) => `Select ${title}`A row's checkbox name. Default "Select {title}".
classNamestring—
emptyActionLabelstring—A button in the empty state ("Send feedback").
emptyBodystringConversations will show up here.
emptyTitlestringNothing here yet
errorbooleanfalseThe read failed: the empty slot shows `errorTitle` / `errorBody` instead.
errorBodystringCheck your connection and try again.
errorTitlestringCouldn't load these
formatTime((date: Date, now: Date) => string)—How a row's time reads. Default: the time today, "Yesterday", the weekday this week, else the date.
hasMorebooleantrueThere are more pages. False stops `onEndReached`. Default true.
headerReactNode—Above the list (a filter, a call to action). Prefer `slots.header` for a component.
labelstringConversationsThe list's name, for a screen reader. Default "Conversations".
loadingbooleanfalseThe first page is loading: a skeleton instead of the empty state.
loadingLabelstringLoadingSaid while the first page loads. Default "Loading".
loadingMorebooleanfalseA next page is loading: the default footer shows a spinner.
loadingMoreLabelstringLoading moreSaid while the next page loads. Default "Loading more".
moreLabelstringMore"More" on a row's action menu.
mutedLabelstringAlerts offWhat a screen reader says for a muted row's bell-slash. Default "Alerts off".
now(() => Date)() => new Date()The clock, for tests.
onCheckedChange((id: string, checked: boolean, options: { shiftKey: boolean; }) => void)—
onEmptyAction(() => void)—
onEndReached(() => void)—Called near the end of the list, to load the next page: once per page (it asks again only after the list grows).
onRefresh(() => void | Promise<void>)—
onSelect((id: string) => void)—A row was opened, when the row has no `onPress` of its own.
pinnedLabelstringPinnedWhat a screen reader says for a pinned row's pin. Default "Pinned".
refreshingboolean—Accepted for parity with native, where it's pull to refresh; the web refreshes from the app.
sectionTitlestring—An optional title over the list.
sectionTitleLevelenum2The section title's heading level. Default 2.
selectedIdstring | null—The open conversation (controlled, bound to the app's route): marks its row `selected`.
slotPropsSlotPropsFor<InboxPageSlotMap>{}
slotsSlots<InboxPageSlotMap>{}
testIDstringinbox-pagetestID on the root. Default `"inbox-page"`.
unreadLabel((count: number | null) => string)(count) => (count ? `${count} unread` : "unread")How a row's unread count reads to a screen reader. Default "3 unread" (and "unread" for a dot).

InboxRowMenu

A row's actions as the web offers them: a More button at the row's end opening a menu, the twin of the phone's swipe and long-press menu. InboxPage's default row draws it; a row of your own (the `row` slot) draws it the same way. Nothing when there are no actions.

PropTypeDefaultDescription
actions*readonly RowSwipeAction[]—The row's actions (`InboxSwipeAction`): every one is listed, destructive ones in red. One a guard refused (`reason`) is dimmed with its reason beneath, and choosing it runs its `onPress`, which explains instead of acting.
label*string—The More button's accessible name ("More: Sam").
testID*string—The row's testID: the button is `<testID>-more`, each item `<testID>-action-<id>`.