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
@marktiderman/genesis-ui/patternsimport { InboxPage } from "@marktiderman/genesis-ui/patterns";react-docgen-typescript.InboxPage
| Prop | Type | Default | Description |
|---|---|---|---|
| items* | InboxItem[] | — | Newest first, as they should show. Empty → the empty state. |
| checked | ReadonlySet<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}". |
| className | string | — | |
| emptyActionLabel | string | — | A button in the empty state ("Send feedback"). |
| emptyBody | string | Conversations will show up here. | |
| emptyTitle | string | Nothing here yet | |
| error | boolean | false | The read failed: the empty slot shows `errorTitle` / `errorBody` instead. |
| errorBody | string | Check your connection and try again. | |
| errorTitle | string | Couldn'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. |
| hasMore | boolean | true | There are more pages. False stops `onEndReached`. Default true. |
| header | ReactNode | — | Above the list (a filter, a call to action). Prefer `slots.header` for a component. |
| label | string | Conversations | The list's name, for a screen reader. Default "Conversations". |
| loading | boolean | false | The first page is loading: a skeleton instead of the empty state. |
| loadingLabel | string | Loading | Said while the first page loads. Default "Loading". |
| loadingMore | boolean | false | A next page is loading: the default footer shows a spinner. |
| loadingMoreLabel | string | Loading more | Said while the next page loads. Default "Loading more". |
| moreLabel | string | More | "More" on a row's action menu. |
| mutedLabel | string | Alerts off | What 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. |
| pinnedLabel | string | Pinned | What a screen reader says for a pinned row's pin. Default "Pinned". |
| refreshing | boolean | — | Accepted for parity with native, where it's pull to refresh; the web refreshes from the app. |
| sectionTitle | string | — | An optional title over the list. |
| sectionTitleLevel | enum | 2 | The section title's heading level. Default 2. |
| selectedId | string | null | — | The open conversation (controlled, bound to the app's route): marks its row `selected`. |
| slotProps | SlotPropsFor<InboxPageSlotMap> | {} | |
| slots | Slots<InboxPageSlotMap> | {} | |
| testID | string | inbox-page | testID 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.
| Prop | Type | Default | Description |
|---|---|---|---|
| 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>`. |