useResourceTable
The list behind {@link ResourcePage }, without any markup: where the rows come from (a `resource` through the data provider, or `data` you pass), search, sort, status filter and paging, selection, the open record (and its URL state), the built-in create/edit form and confirmed delete, and the row handlers. Takes the same options as `ResourcePage`. Use it to build a different layout over the same behaviour; `ResourcePage` itself is this behaviour plus Genesis's markup.
packages/ui/src/components/data/use-resource-table.ts
@marktiderman/genesis-ui/dataimport { useResourceTable } from "@marktiderman/genesis-ui/data";react-docgen-typescript.useResourceTableModel
Everything ResourcePage's markup reads. Internal: its names may change in any release. Apps use {@link useResourceTable}.
| Prop | Type | Default | Description |
|---|---|---|---|
| title* | string | — | |
| allowCreate | boolean | — | Enable built-in create form (ignored if onCreate callback is provided). |
| allowDelete | boolean | — | Built-in delete for `resource` mode (ignored if `onDelete` is provided): the peek's Delete button opens a confirm dialog, then calls `useResource`'s `remove` with the row's `getKey` (when supplied) or its `id` — which invalidates the list — and closes the peek. A failure shows in the dialog. |
| allowEdit | boolean | — | Enable built-in edit form (ignored if onEdit callback is provided). |
| bulkActions | { label: string; icon?: LucideIcon; variant?: "default" | "destructive"; onAction: (ids: string[], context: ResourceBulkContext<T>) => void | Promise<...>; reason?: string | ... 1 more ... | undefined; matching?: boolean | undefined; disabled?: boolean | undefined; testId?: string | undefined... | — | |
| bulkDelete | boolean | { reason?: ((item: T) => string); } | undefined | — | Offer Delete in the bulk bar, over the page's own delete path (ADR 0017 §2): the provider's delete under `can`, with the recycle-bin wording when the provider has one, one confirm step for the rows chosen. Only for a list the page loads itself with its built-in delete: a screen that deletes through `onDelete`, or a list of `data` rows, adds its own bulk action. `reason` words a row `can` refuses. Default off. |
| can | ((action: ResourceAction, item?: T) => boolean) | — | What the signed-in user may do: `can("create")`, `can("edit", item)`, `can("delete", item)`. Return false to hide the New button, or a row's Edit or Delete (and the built-in edit form won't open for it). Omitted, everything the handlers allow is offered. A UI gate only: the server must still refuse the write. |
| canDelete | ((item: T) => boolean) | — | @deprecated Use `can` — `can={(action, item) => action !== "delete" || !item || mayDelete(item)}`. Still honoured: a row it refuses gets no Delete. |
| canEdit | ((item: T) => boolean) | — | @deprecated Use `can` — `can={(action, item) => action !== "edit" || !item || mayEdit(item)}`. Still honoured: a row it refuses gets no Edit. |
| canEditItem | ((item: T) => boolean) | — | @deprecated Use `can` — `can={(action, item) => !item || mayChange(item)}`. Removed in the next minor after one deprecation window. Still honoured: a row it refuses gets no Edit and no Delete. |
| canSaveViews | boolean | — | Show the "save current view" affordance. |
| capabilities | { search?: boolean; sort?: boolean; } | undefined | — | What the data source can do. A control it can't serve is hidden rather than left to error (DATA.md decision 9): `search: false` hides the search box, `sort: false` the sort select. Pass a provider's `capabilities()` straight in. Omitted, both show, as before. |
| className | string | — | Merged onto the page shell's root. |
| clientRowLimit | number | — | `pagination="client"` only: the most rows fetched. Default 1000. An explicit `resourceOptions.defaultPerPage` wins. Keep it at or under the provider's `maxPerPage` (`capabilities().maxPerPage`; 1000 by default for Supabase): a larger page is refused, not cut short. |
| columns | (string | ResourceColumnDef<T>)[] | — | |
| columnVisibility | boolean | — | Show the column-visibility dropdown. DataTable's default is `true`. |
| columnVisibilityKey | string | — | Persist key for the user's column-visibility picks. |
| compactWhenShort | boolean | — | Opt-in. An embedded list (`variant="embedded"`) with ten rows or fewer and nothing typed or chosen in its filters drops its search and sort row, Columns bar and pager: they'd be most of its height (a record's child list). Past ten rows, or while anything filters it, they come back. Default false. |
| confirmDelete | boolean | ResourceDeleteConfirmCopy<T> | — | Confirm before deleting. Defaults to `true` for `allowDelete` and `false` for `onDelete` (which keeps its old, unconfirmed behaviour). Pass an object to set the dialog's copy. |
| countFormat | { one?: string; other?: string; filtered?: string | undefined; } | undefined | — | The count's words; see PageHeader `countFormat`. |
| createdToast | boolean | — | Opt-in. After the built-in form creates a row, show a "Created {name}" toast whose Open action opens the new row as a row click would (the peek, or the route), and move focus to Open, so a keyboard user can reach it before it goes (the toaster sits last in the Tab order). Tab or Escape leaves the toast, and focus goes back to the New button. Needs a mounted `<Toaster />`. Only a pessimistic save (the default) has the new row's key, so an optimistic or undoable create, or `detail="none"`, gets the toast without Open, and focus stays on New. Default false: no toast. |
| createLabel | string | — | |
| data | T[] | — | Server-data mode: pre-fetched data array. |
| defaultView | ViewModeDefault | — | The view shown until the user picks one with the view toggle. Default `"table"`. Pass `{ mobile: "grid", desktop: "table" }` for cards on phones and a table on desktops. Only an explicit pick is persisted, so the responsive default stays responsive until the user chooses. |
| detail | enum | — | How a row opens (a record page, ADR 0021): `"panel"` (default) or `"side-peek"`, a sheet at the edge; `"modal"` or `"center-peek"`, a centered dialog; `"route"` or `"page"`, the record's own route through `onNavigate`; `"none"`. The peek words are the preferred ones. |
| detailFields | { key: string; label: string; render?: ((value: unknown, item: T) => ReactNode); }[] | — | |
| detailWidth | enum | — | |
| dialogs | ReactNode | — | Dialogs the page's own actions open, drawn with the page in every layout (a view action's confirmation, from `useResourceViewProps`). Rendered as given. |
| emptyCreate | boolean | — | Opt-in. With no rows and nothing filtering them, the list's own create button moves from the header into the empty state (so there's one, where the eye already is), unless `emptyState` gives an action of its own, and the search and sort row, with nothing to act on, is left out. While anything filters the list (a search, a status, a filter combobox, or `emptyFiltered`) the header keeps the button and the filter row stays. Default false: the button stays in the header and the filter row shows, as before. |
| emptyDescription | string | — | A sentence under the empty-state title — forwarded to `DataPageShell`. |
| emptyFiltered | boolean | — | The screen narrows this list itself (a tab like "Open" over its own filter), so an empty list isn't empty of records: with `emptyCreate`, the create button stays in the header and the filter row stays. No effect without `emptyCreate`. |
| emptyIcon | LucideIcon | — | The empty state's icon. |
| emptyMessage | string | — | The empty state's title, e.g. "No tasks yet". Default "No results found". |
| emptyState | ReactNode | — | The empty state's action, e.g. the create button. |
| error | boolean | — | Server-data mode: the caller's fetch failed, so render the shell's error panel instead of an empty table. Takes effect even when `data` is non-empty — stale rows beside no indication of failure are exactly the silent-failure this prop exists to prevent. Ignored in client-side mode, where `useResource`'s own error state is used. |
| errorMessage | string | — | Message shown in the error panel, in place of the shell's generic "Failed to load …". Forwarded in both modes — it is inert unless an error state is actually showing — so a client-side page can also give its failure a human sentence. |
| filters | DataFilterConfig[] | — | Extra multi-select filter comboboxes, handed straight to `DataFilters` and rendered beside the status chips. Each config owns its own `selected` array and `onChange` — ResourcePage never reads or writes them, because it cannot know what a caller's "Grade" or "Subject" combobox means against the row shape. That is deliberate rather than a gap: the built-in machinery (`searchFields`, `statusFilter`) covers the two shapes it *can* interpret, and this prop covers everything else by getting out of the way. Two consequences of that hands-off stance, stated rather than hidden: - These selections are invisible to `page.hasActiveFilters`, so the header's "Clear filters" affordance does not appear for them alone, and `onClearFilters` does not reset them. DataFilters' own "Clear all" does call each config's `onChange([])`, so wire real clearing there. - In client-side mode the rows are NOT re-filtered by these selections. A caller using them is expected to filter its own `data` (or ask the server to), exactly as it already does in server-controlled mode. |
| formFields | ResourceFormFieldDef[] | — | Field definitions for the built-in form. |
| formLayout | enum | — | Layout mode for the built-in form container. If not set, defaults to sheet for edit, dialog for create. |
| formMode | enum | — | Form presentation mode. Default "standard". |
| formSteps | WizardStep[] | — | Wizard step definitions. Required when formMode is "wizard". |
| formTitles | { create?: string; edit?: string; createSubmit?: string | undefined; editSubmit?: string | undefined; createDescription?: string | undefined; editDescription?: string | undefined; } | undefined | — | The built-in form's words. `create` / `edit`: its titles, over "New {noun}" / "Edit {noun}". `createSubmit` / `editSubmit`: its submit button, over "Create" / "Save". `createDescription` / `editDescription`: its description (read out with the title), over the UI catalogue's `form.createDescription` / `form.editDescription`. A `slotProps.form` value still wins. |
| getKey | ((item: T) => string) | — | A row's identity, for React keys and bulk selection. Defaults to `String(item.id)`. Supply it for rows keyed some other way — a composite key (`encodeRecordKey` from `@marktiderman/genesis-core/schema`), or a table whose key column isn't called `id`. Detail `route` mode still navigates by `item.id`. |
| getSubtitle | ((item: T) => string) | — | The detail peek's subtitle, computed from the row ("2 staff", "Due Friday"). Wins over `subtitleField`, which can only show one column verbatim. |
| getTitle | ((item: T) => string) | — | Name a record from more than one field (`${first} ${last}`). Wins over `titleField` for the detail title and the card's accessible name. |
| gridCols | string | — | Tailwind grid-column classes for the card grid, passed through to `DataGrid`'s `gridCols` — e.g. `"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3"`. Defaults to DataGrid's own responsive 1/2/3/4-column ramp. |
| header | enum | — | `"page"` (default) renders the full header with the title. `"toolbar"` keeps the header's actions (count, view toggle, settings, create) and drops the title block — for a list inside a tab or card whose page already has the heading. See `DataPageShell`'s `header`. |
| heldFilters | { active: boolean; clear: () => void; } | — | Filters the caller holds (a view's segment and declared filters, ADR 0017): while `active`, they count toward "Clear filters" and the empty state's filtered wording, and clearing the list calls `clear` too. |
| icon | LucideIcon | — | |
| initialFilters | FilterParam[] | — | |
| keyboardNavigation | boolean | — | Built-in list keyboard navigation via `useKeyboardNavigation`: j/k (or Arrow Up/Down) move a focus cursor, Enter opens the focused item, Backspace (⌫) closes an open detail view, and x toggles the focused item's selection when `bulkActions` are configured. Set to `false` to opt out. Default-on, and scoped so that being on by default stays safe: - The j/k cursor runs while the grid or list view is showing. Table view keeps its own sort/pagination, so there `DataTable` handles the keys on its focusable rows instead (↑/↓ or j/k, Home/End, Enter, x); this prop turns that off too. - Cursor keys suspend while a detail panel/modal or the built-in form is open, so they can't drive the list behind the overlay; ⌫ stays live there so it can close it. - Backspace is only intercepted while there's an open detail to close. - Modified chords (Ctrl/Cmd/Alt) are never captured, so an app's Cmd+K-style shortcuts keep working. |
| live | boolean | LiveOptions | — | `resource` mode: refetch the list (and the open record) when the provider reports a change, e.g. Supabase Realtime. Shorthand for `resourceOptions.live`, which wins. See core's `UseResourceOptions.live`. |
| loading | boolean | — | Server-data mode: the caller's fetch is in flight, so render the shell's loading skeleton instead of the (as yet meaningless) `data`. Ignored in client-side mode, where `useResource`'s own loading state is used. |
| mutationMode | enum | — | When the built-in form's saves and deletes reach the list: `"pessimistic"` (default, wait for the provider), `"optimistic"` or `"undoable"` (an Undo toast). See ResourceForm `mutationMode`. `resourceOptions.mutationMode` wins for deletes. |
| noun | string | — | What one record is called ("goal"), for the count and the form's title. Default: the title, lower-cased, for the count, and the resource name for the form (as before). |
| nounPlural | string | — | Several records ("people"), when not `noun` + "s". |
| onCreate | (() => void) | — | |
| onDelete | ((item: T) => void | Promise<void>) | — | Delete handler, shown as the detail peek's Delete button. Called directly, as before, unless `confirmDelete` is set — then it runs after the confirm dialog, which shows its error if the returned promise rejects, and closes the peek when it resolves. |
| onDeleted | ((item: T) => void) | — | Called after a confirmed or built-in delete succeeds — e.g. a toast. |
| onDeleteView | ((id: string) => void) | — | |
| onEdit | ((item: T) => void) | — | |
| onExport | ((query: ResourceListQuery) => void | Promise<void>) | — | Offer "Export CSV" in the header's menu (ADR 0017 §8): called with the list's query (its filters, sort and search) to export every row it matches, not one page. With a `resource`, that is the resource's query plus what the page applies in the browser (`pagination="client"`): its search, sort and status chips. With the caller's `data`, it carries the page's search, sort and status chips, but not filters the caller applies to its data itself: the caller adds those. "Select all matching" bulk actions get the same query. With server or cursor paging the search is the provider's own. `total` is the server's count, left out while a client-paged page narrows its rows in the browser (a search or a chip the provider didn't see). |
| onFiltersChange | ((filters: FilterParam[]) => void) | — | |
| onLoadView | ((filters: Record<string, unknown>) => void) | — | |
| onNavigate | NavigateFn | — | Imperative navigation used only when `detail="route"` (navigates to `/{resource}/{id}` on row click). Defaults to a full-page navigation. Router consumers pass their navigate fn — e.g. RR `useNavigate()` or Next `router.push`. |
| onPageChange | ((page: number) => void) | — | Called with the next 1-based page number. The pager only renders when this is supplied AND both `perPage` and `total` are supplied — see {@link perPage} and {@link total}. Supplying this without either one renders an error naming the missing props instead of a pager. Status changes reach the server through `onFiltersChange` — not a dedicated callback here — because `statusFilter` state is tracked by the same filter machinery that already calls `onFiltersChange` regardless of controlled mode (see {@link statusFilter}). In server-controlled mode a status change also calls `onPageChange(1)` directly, since the previous page number is meaningless against a new filtered result set. |
| onPerPageChange | ((perPage: number) => void) | — | Called when the user picks a different page size in the header's view settings. |
| onQueryChange | ((query: { search: string; sort: SortParam | null; }) => void) | — | Hears the list's search and sort as they change (it only listens: the page keeps them). A saved view stores them from here. |
| onRetry | (() => void) | — | Server-data mode: invoked by the error panel's Retry button. The button only appears when this is supplied, so a caller with no way to retry simply omits it and gets an error panel without a dead control. In client-side mode the button is already wired to `useResource`'s own `refetch` and this prop is ignored. |
| onSaved | ((row: T, action: "create" | "edit") => void) | — | After the built-in form saves: the row and whether it was a create or an edit (to open a builder for a new row, say). A pessimistic save (the default) runs it once the server has the row, and gives that row with its key. An optimistic or undoable save runs it as the save is accepted, before the write lands: the values sent, no key for a create, and it isn't taken back by an undo. A `slotProps.form.onSuccess` replaces it; a `slots.form` runs it by calling its `onSuccess`. |
| onSaveView | ((name: string) => void) | — | |
| onSearchChange | ((search: string) => void) | — | Called when the user changes the search text (including clearing it). |
| onSortChange | ((sort: SortParam | null) => void) | — | Called when the user changes the sort, with `null` when the sort is cleared. |
| onViewModeChange | ((mode: ViewMode) => void) | — | Hears the view toggle, with `viewMode` or without. |
| openOnCardClick | boolean | — | With a custom `renderCard`: make each whole card (and list row) one keyboard-reachable button that opens the detail, so the card needs no `actions.open()` wiring and no hand-rolled `div role="button"`. Links and buttons inside the card keep their own clicks. Off by default, because an existing card that already calls `open()` would fire it twice. |
| page | number | — | Current page, 1-based. Server-controlled mode only. |
| pagerJumps | boolean | — | Opt-in. The pagers (this page's and the table's own) get first and last page buttons, the table's says "Page n of m", and the arrows are named "Previous page" / "Next page"; on a phone this page's pager shows only the arrows. Default false: the pagers draw as before. |
| pageSizeOptions | number[] | — | Page-size choices offered by `DataTable`'s own pager. Client-side mode only — server-controlled mode switches that pager off. (The header's view-settings popover has its own fixed 10/25/50/100 list.) |
| pagination | enum | — | How `resource` mode reaches rows past the first page. Ignored with `data` (server-data mode pages through the controlled props instead). - `"client"` (default): fetch up to `clientRowLimit` rows in one request and search, sort, filter and page them in the browser — header-click sort and instant search keep working. If the resource holds more rows than that, a notice under the list says how many are shown (and a console warning names this prop), rather than silently truncating. - `"server"`: fetch one page at a time. The pager under the list drives `useResource`'s page, the header's page size its `perPage`, and search / sort / status chips become provider queries (search is debounced), and the current page stays on screen while the next one loads. Give `statusFilter` explicit `options` here — derived ones can only see the current page's values. Search needs `searchFields` (or `resourceOptions.searchFields`) — the provider must be told which columns to match — so the search box is hidden without them. Table header sorting is withdrawn, as in server-data mode; the sort control in the filter row drives the query. - `"cursor"`: loads `perPage` rows (`resourceOptions.defaultPerPage`, else the stored page size) and a "Load more" button appends the next page, by cursor where the provider serves it (`capabilities().cursorPagination`) and by offset otherwise. The server orders by `resourceOptions.defaultSort`; search, sort and filters in the toolbar act on the rows loaded so far. |
| perPage | number | — | Rows per page the server was asked for. Required whenever `onPageChange` is supplied: pager math (total pages, range start, Next) cannot be inferred from `data.length`, because a short final page is smaller than the real page size. Wins over the per-user page size persisted by `viewSettingsKey` — an explicit prop always beats a stored preference. Required whenever `onPageChange` is supplied. A short final page (the server's last page returning fewer rows than its page size) is indistinguishable from a small page size — there is no correct way to infer the divisor from the rows handed back. Rather than guess and render a wrong range or a stuck Next button, the component refuses to render the pager and shows an error instead when `onPageChange` is present without `perPage`. `total` is required on the same terms — see {@link total}. The error names every missing prop, not just the first. |
| renderCard | ((item: T, index: number, actions: ResourceCardActions<T>) => ReactNode) | — | Override the default card renderer used for grid view (and, absent a dedicated list layout, list view too — DataGrid falls back to the same renderer there). ResourcePage still owns data-fetching, filtering, sorting, and layout (grid columns, infinite-scroll batching, stagger animation) — this only swaps what's rendered inside each item slot. Receives `ResourceCardActions`: the row's `update`/`remove`/`refetch` plus `open()` to activate the row (opening the configured detail panel/modal/route). Row activation is *not* applied automatically to a custom card — wrapping it would double-fire against cards that bring their own click handling and would hijack clicks on nested buttons — so call `actions.open()` from wherever your card should activate. |
| renderDetail | ((item: T) => ReactNode) | — | |
| renderForm | ((form: UseFormReturn<Record<string, unknown>>, fields: ResourceFormFieldDef[]) => ReactNode) | — | Custom form renderer — receives form instance and resolved fields. |
| renderTable | ((items: T[]) => ReactNode) | — | Replace the built-in `DataTable` that table view renders, keeping every other piece of the page — header, counts, view settings, filters, bulk bar, detail panel, form, pager — exactly as it is. The counterpart to `renderCard`, which does the same for grid and list view. Receives the rows for the current view, which in server-controlled mode is precisely the page the server returned. Ownership is total: row click-through, selection, density, column visibility and resizing are all things the built-in table wires for you and a custom table must wire for itself. That is the trade this prop makes, and it is why `renderCard` remains the lighter option when only the *cells* need to change — a `ResourceColumnDef.render` is lighter still. Omitted, the default `DataTable` render is used unchanged. |
| resizableColumns | boolean | — | Allow drag-resizing columns. DataTable's default is `true`. |
| resizeKey | string | — | Persist key for the user's column widths. |
| resource | string | — | Client-side mode: resource name passed to useResource / DataProvider. |
| resourceOptions | UseResourceOptions<T> | — | |
| restoreKey | string | number | — | The page starts again (its search, sort and status from `initialFilters`) when this changes: `useResourceViewProps` sets it when a saved view is restored, so a screen that renders its own `<ResourcePage {...props}>` picks the saved search and sort up as `<ResourceView>` does. |
| rowMenu | ((item: T, builtIn: ResourceRowMenuBuiltIn) => ResourceRowMenuItem[]) | — | A menu on each table row (ADR 0017 §2): a trailing "More" button and the same items on right-click. It gets the row and the page's own edit and delete for it (when the page offers them), so it can place them around its own items; an item with a `reason` shows disabled with those words. ResourceView builds it from the view's actions and guards. |
| savedViews | SavedViewItem[] | — | Saved filter views to offer. Pair with `useSavedViews` for per-user storage. |
| searchFields | string[] | — | |
| searchPlaceholder | string | — | |
| secondaryActions | PageHeaderAction[] | — | Extra header actions beyond the create button, in one overflow menu. See {@link PageHeaderAction} — the budget is one primary, the rest here. |
| slotProps | SlotPropsFor<ResourcePageSlotMap<T>> | — | Extra props merged into a part you are KEEPING. Wins over ours. |
| slots | ResourcePageSlots<T> | — | The interior parts `ResourcePage` composes, by name. Replace one with your own component, or pass `null` to eject it entirely — see {@link ResourcePageSlots}. This is the reason a surface that needs one part to differ does not have to drop to the primitives and re-derive the pagination, selection and detail wiring that were already correct. A `grid` replacement that draws its own items and should open them sets a static `opensItems = true` (as ResourceView's gallery does): it then gets `onItemClick` and `getItemLabel`, which open the row's detail. Without it, a grid slot gets them only with `openOnCardClick` and a `renderCard`, as before. |
| statusFilter | string | { field: string; options?: string[]; } | — | Adds a status-chip filter. There is no dedicated status-change callback: chip clicks update the same filter state that already reports through `onFiltersChange`, whether or not the page is in server-controlled mode. A caller combining `statusFilter` with server pagination (`onPageChange` et al.) must supply `onFiltersChange` — see that prop — or status changes will update the chip UI without ever reaching the server. In server-controlled mode a status change also resets to page 1 via `onPageChange(1)` — see {@link onPageChange}. |
| stickyFirstColumn | boolean | — | Keep the first column visible while scrolling horizontally. |
| stickyHeader | boolean | — | Keep the table header visible while scrolling. DataTable's default is `true`. |
| subtitle | string | — | Page subtitle shown below the title. |
| subtitleField | string | — | |
| titleField | string | — | |
| toolbar | ReactNode | — | |
| total | number | — | Server-data mode: total record count (before client-side filtering). Required whenever `onPageChange` is supplied. It cannot be derived from `data`, which holds only the current page. Omitted, `displayTotal` falls back to `0`, so the range span reads "No records" and `Next` stays disabled while the rows render directly below it. Rather than show a pager that contradicts the list, the component refuses to render the pager and shows an error instead. See {@link perPage} and {@link onPageChange}. |
| tree | ResourceTree<T> | — | Tree mode: rows nest under the row `getParentId` names, built from the flat rows by genesis-core's `treeRows` (docs/RESOURCE-VIEW.md, "Tree mode"). Sort applies within siblings, search and the status filter keep each match's ancestors, open state is controlled (`expanded`, `onExpandedChange`) or not (`defaultExpanded`), and `cascadeSelect` makes selecting a row select its descendants. Table and list views draw the indent and the expand arrow; grid and custom cards stay flat. Client data only: `pagination="client"` (the default) or `data`; server and cursor paging throw. |
| urlState | SearchParamsAdapter | ResourceUrlStateOptions | — | Keep the list's state in the URL: the open record (`?id=`), the search (`q`), the sort (`sort=field:asc`) and, with `pagination="server"`, the page. Pass your router's search-params adapter (`useReactRouterSearchParams()`, `useTanStackRouterSearchParams()`, or `useBrowserSearchParams()` with no router), or `{ searchParams, params }` to rename the keys. A copied link reopens the same record, and Back closes one that was opened. Search and sort are read when the page mounts and written as they change. A server-controlled page owns its own page, sort and search: use `useResourceUrlState` there. |
| variant | enum | — | `"page"` (default): a full list page. `"embedded"`: a list inside another page (a tab, a card, a side panel), whose page already has the heading, filters and shortcuts. Embedded sets, unless you set them: - `header="toolbar"`, showing only the create button, and the view toggle when there is a `renderCard`. No title, count, view settings or header options menu (`slotProps.shell.headerOptions` still win; an explicit `header="page"` keeps the full header); - no filter row, unless you pass `filters`, `statusFilter`, `searchFields` or saved views, or the list is already filtered (a search in the URL, say); - `keyboardNavigation={false}`, since j/k shortcuts belong to the page. |
| viewMode | enum | — | The view mode (`table`, `list`, `grid`), held by the caller: the person's stored pick is neither read nor written while it's set (ResourceView's type switcher holds it). |
| viewSettingsKey | string | — | Persist key for density / page size via `useViewSettings`. Defaults to `resource` or a slug of `title`. |
useResourceTable
The list behind {@link ResourcePage }, without any markup: where the rows come from (a `resource` through the data provider, or `data` you pass), search, sort, status filter and paging, selection, the open record (and its URL state), the built-in create/edit form and confirmed delete, and the row handlers. Takes the same options as `ResourcePage`. Use it to build a different layout over the same behaviour; `ResourcePage` itself is this behaviour plus Genesis's markup.
| Prop | Type | Default | Description |
|---|---|---|---|
| title* | string | — | |
| allowCreate | boolean | — | Enable built-in create form (ignored if onCreate callback is provided). |
| allowDelete | boolean | — | Built-in delete for `resource` mode (ignored if `onDelete` is provided): the peek's Delete button opens a confirm dialog, then calls `useResource`'s `remove` with the row's `getKey` (when supplied) or its `id` — which invalidates the list — and closes the peek. A failure shows in the dialog. |
| allowEdit | boolean | — | Enable built-in edit form (ignored if onEdit callback is provided). |
| bulkActions | { label: string; icon?: LucideIcon; variant?: "default" | "destructive"; onAction: (ids: string[], context: ResourceBulkContext<T>) => void | Promise<...>; reason?: string | ... 1 more ... | undefined; matching?: boolean | undefined; disabled?: boolean | undefined; testId?: string | undefined... | — | |
| bulkDelete | boolean | { reason?: ((item: T) => string); } | undefined | — | Offer Delete in the bulk bar, over the page's own delete path (ADR 0017 §2): the provider's delete under `can`, with the recycle-bin wording when the provider has one, one confirm step for the rows chosen. Only for a list the page loads itself with its built-in delete: a screen that deletes through `onDelete`, or a list of `data` rows, adds its own bulk action. `reason` words a row `can` refuses. Default off. |
| can | ((action: ResourceAction, item?: T) => boolean) | — | What the signed-in user may do: `can("create")`, `can("edit", item)`, `can("delete", item)`. Return false to hide the New button, or a row's Edit or Delete (and the built-in edit form won't open for it). Omitted, everything the handlers allow is offered. A UI gate only: the server must still refuse the write. |
| canDelete | ((item: T) => boolean) | — | @deprecated Use `can` — `can={(action, item) => action !== "delete" || !item || mayDelete(item)}`. Still honoured: a row it refuses gets no Delete. |
| canEdit | ((item: T) => boolean) | — | @deprecated Use `can` — `can={(action, item) => action !== "edit" || !item || mayEdit(item)}`. Still honoured: a row it refuses gets no Edit. |
| canEditItem | ((item: T) => boolean) | — | @deprecated Use `can` — `can={(action, item) => !item || mayChange(item)}`. Removed in the next minor after one deprecation window. Still honoured: a row it refuses gets no Edit and no Delete. |
| canSaveViews | boolean | — | Show the "save current view" affordance. |
| capabilities | { search?: boolean; sort?: boolean; } | undefined | — | What the data source can do. A control it can't serve is hidden rather than left to error (DATA.md decision 9): `search: false` hides the search box, `sort: false` the sort select. Pass a provider's `capabilities()` straight in. Omitted, both show, as before. |
| className | string | — | Merged onto the page shell's root. |
| clientRowLimit | number | — | `pagination="client"` only: the most rows fetched. Default 1000. An explicit `resourceOptions.defaultPerPage` wins. Keep it at or under the provider's `maxPerPage` (`capabilities().maxPerPage`; 1000 by default for Supabase): a larger page is refused, not cut short. |
| columns | (string | ResourceColumnDef<T>)[] | — | |
| columnVisibility | boolean | — | Show the column-visibility dropdown. DataTable's default is `true`. |
| columnVisibilityKey | string | — | Persist key for the user's column-visibility picks. |
| compactWhenShort | boolean | — | Opt-in. An embedded list (`variant="embedded"`) with ten rows or fewer and nothing typed or chosen in its filters drops its search and sort row, Columns bar and pager: they'd be most of its height (a record's child list). Past ten rows, or while anything filters it, they come back. Default false. |
| confirmDelete | boolean | ResourceDeleteConfirmCopy<T> | — | Confirm before deleting. Defaults to `true` for `allowDelete` and `false` for `onDelete` (which keeps its old, unconfirmed behaviour). Pass an object to set the dialog's copy. |
| countFormat | { one?: string; other?: string; filtered?: string | undefined; } | undefined | — | The count's words; see PageHeader `countFormat`. |
| createdToast | boolean | — | Opt-in. After the built-in form creates a row, show a "Created {name}" toast whose Open action opens the new row as a row click would (the peek, or the route), and move focus to Open, so a keyboard user can reach it before it goes (the toaster sits last in the Tab order). Tab or Escape leaves the toast, and focus goes back to the New button. Needs a mounted `<Toaster />`. Only a pessimistic save (the default) has the new row's key, so an optimistic or undoable create, or `detail="none"`, gets the toast without Open, and focus stays on New. Default false: no toast. |
| createLabel | string | — | |
| data | T[] | — | Server-data mode: pre-fetched data array. |
| defaultView | ViewModeDefault | — | The view shown until the user picks one with the view toggle. Default `"table"`. Pass `{ mobile: "grid", desktop: "table" }` for cards on phones and a table on desktops. Only an explicit pick is persisted, so the responsive default stays responsive until the user chooses. |
| detail | enum | — | How a row opens (a record page, ADR 0021): `"panel"` (default) or `"side-peek"`, a sheet at the edge; `"modal"` or `"center-peek"`, a centered dialog; `"route"` or `"page"`, the record's own route through `onNavigate`; `"none"`. The peek words are the preferred ones. |
| detailFields | { key: string; label: string; render?: ((value: unknown, item: T) => ReactNode); }[] | — | |
| detailWidth | enum | — | |
| dialogs | ReactNode | — | Dialogs the page's own actions open, drawn with the page in every layout (a view action's confirmation, from `useResourceViewProps`). Rendered as given. |
| emptyCreate | boolean | — | Opt-in. With no rows and nothing filtering them, the list's own create button moves from the header into the empty state (so there's one, where the eye already is), unless `emptyState` gives an action of its own, and the search and sort row, with nothing to act on, is left out. While anything filters the list (a search, a status, a filter combobox, or `emptyFiltered`) the header keeps the button and the filter row stays. Default false: the button stays in the header and the filter row shows, as before. |
| emptyDescription | string | — | A sentence under the empty-state title — forwarded to `DataPageShell`. |
| emptyFiltered | boolean | — | The screen narrows this list itself (a tab like "Open" over its own filter), so an empty list isn't empty of records: with `emptyCreate`, the create button stays in the header and the filter row stays. No effect without `emptyCreate`. |
| emptyIcon | LucideIcon | — | The empty state's icon. |
| emptyMessage | string | — | The empty state's title, e.g. "No tasks yet". Default "No results found". |
| emptyState | ReactNode | — | The empty state's action, e.g. the create button. |
| error | boolean | — | Server-data mode: the caller's fetch failed, so render the shell's error panel instead of an empty table. Takes effect even when `data` is non-empty — stale rows beside no indication of failure are exactly the silent-failure this prop exists to prevent. Ignored in client-side mode, where `useResource`'s own error state is used. |
| errorMessage | string | — | Message shown in the error panel, in place of the shell's generic "Failed to load …". Forwarded in both modes — it is inert unless an error state is actually showing — so a client-side page can also give its failure a human sentence. |
| filters | DataFilterConfig[] | — | Extra multi-select filter comboboxes, handed straight to `DataFilters` and rendered beside the status chips. Each config owns its own `selected` array and `onChange` — ResourcePage never reads or writes them, because it cannot know what a caller's "Grade" or "Subject" combobox means against the row shape. That is deliberate rather than a gap: the built-in machinery (`searchFields`, `statusFilter`) covers the two shapes it *can* interpret, and this prop covers everything else by getting out of the way. Two consequences of that hands-off stance, stated rather than hidden: - These selections are invisible to `page.hasActiveFilters`, so the header's "Clear filters" affordance does not appear for them alone, and `onClearFilters` does not reset them. DataFilters' own "Clear all" does call each config's `onChange([])`, so wire real clearing there. - In client-side mode the rows are NOT re-filtered by these selections. A caller using them is expected to filter its own `data` (or ask the server to), exactly as it already does in server-controlled mode. |
| formFields | ResourceFormFieldDef[] | — | Field definitions for the built-in form. |
| formLayout | enum | — | Layout mode for the built-in form container. If not set, defaults to sheet for edit, dialog for create. |
| formMode | enum | — | Form presentation mode. Default "standard". |
| formSteps | WizardStep[] | — | Wizard step definitions. Required when formMode is "wizard". |
| formTitles | { create?: string; edit?: string; createSubmit?: string | undefined; editSubmit?: string | undefined; createDescription?: string | undefined; editDescription?: string | undefined; } | undefined | — | The built-in form's words. `create` / `edit`: its titles, over "New {noun}" / "Edit {noun}". `createSubmit` / `editSubmit`: its submit button, over "Create" / "Save". `createDescription` / `editDescription`: its description (read out with the title), over the UI catalogue's `form.createDescription` / `form.editDescription`. A `slotProps.form` value still wins. |
| getKey | ((item: T) => string) | — | A row's identity, for React keys and bulk selection. Defaults to `String(item.id)`. Supply it for rows keyed some other way — a composite key (`encodeRecordKey` from `@marktiderman/genesis-core/schema`), or a table whose key column isn't called `id`. Detail `route` mode still navigates by `item.id`. |
| getSubtitle | ((item: T) => string) | — | The detail peek's subtitle, computed from the row ("2 staff", "Due Friday"). Wins over `subtitleField`, which can only show one column verbatim. |
| getTitle | ((item: T) => string) | — | Name a record from more than one field (`${first} ${last}`). Wins over `titleField` for the detail title and the card's accessible name. |
| gridCols | string | — | Tailwind grid-column classes for the card grid, passed through to `DataGrid`'s `gridCols` — e.g. `"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3"`. Defaults to DataGrid's own responsive 1/2/3/4-column ramp. |
| header | enum | — | `"page"` (default) renders the full header with the title. `"toolbar"` keeps the header's actions (count, view toggle, settings, create) and drops the title block — for a list inside a tab or card whose page already has the heading. See `DataPageShell`'s `header`. |
| heldFilters | { active: boolean; clear: () => void; } | — | Filters the caller holds (a view's segment and declared filters, ADR 0017): while `active`, they count toward "Clear filters" and the empty state's filtered wording, and clearing the list calls `clear` too. |
| icon | LucideIcon | — | |
| initialFilters | FilterParam[] | — | |
| keyboardNavigation | boolean | — | Built-in list keyboard navigation via `useKeyboardNavigation`: j/k (or Arrow Up/Down) move a focus cursor, Enter opens the focused item, Backspace (⌫) closes an open detail view, and x toggles the focused item's selection when `bulkActions` are configured. Set to `false` to opt out. Default-on, and scoped so that being on by default stays safe: - The j/k cursor runs while the grid or list view is showing. Table view keeps its own sort/pagination, so there `DataTable` handles the keys on its focusable rows instead (↑/↓ or j/k, Home/End, Enter, x); this prop turns that off too. - Cursor keys suspend while a detail panel/modal or the built-in form is open, so they can't drive the list behind the overlay; ⌫ stays live there so it can close it. - Backspace is only intercepted while there's an open detail to close. - Modified chords (Ctrl/Cmd/Alt) are never captured, so an app's Cmd+K-style shortcuts keep working. |
| live | boolean | LiveOptions | — | `resource` mode: refetch the list (and the open record) when the provider reports a change, e.g. Supabase Realtime. Shorthand for `resourceOptions.live`, which wins. See core's `UseResourceOptions.live`. |
| loading | boolean | — | Server-data mode: the caller's fetch is in flight, so render the shell's loading skeleton instead of the (as yet meaningless) `data`. Ignored in client-side mode, where `useResource`'s own loading state is used. |
| mutationMode | enum | — | When the built-in form's saves and deletes reach the list: `"pessimistic"` (default, wait for the provider), `"optimistic"` or `"undoable"` (an Undo toast). See ResourceForm `mutationMode`. `resourceOptions.mutationMode` wins for deletes. |
| noun | string | — | What one record is called ("goal"), for the count and the form's title. Default: the title, lower-cased, for the count, and the resource name for the form (as before). |
| nounPlural | string | — | Several records ("people"), when not `noun` + "s". |
| onCreate | (() => void) | — | |
| onDelete | ((item: T) => void | Promise<void>) | — | Delete handler, shown as the detail peek's Delete button. Called directly, as before, unless `confirmDelete` is set — then it runs after the confirm dialog, which shows its error if the returned promise rejects, and closes the peek when it resolves. |
| onDeleted | ((item: T) => void) | — | Called after a confirmed or built-in delete succeeds — e.g. a toast. |
| onDeleteView | ((id: string) => void) | — | |
| onEdit | ((item: T) => void) | — | |
| onExport | ((query: ResourceListQuery) => void | Promise<void>) | — | Offer "Export CSV" in the header's menu (ADR 0017 §8): called with the list's query (its filters, sort and search) to export every row it matches, not one page. With a `resource`, that is the resource's query plus what the page applies in the browser (`pagination="client"`): its search, sort and status chips. With the caller's `data`, it carries the page's search, sort and status chips, but not filters the caller applies to its data itself: the caller adds those. "Select all matching" bulk actions get the same query. With server or cursor paging the search is the provider's own. `total` is the server's count, left out while a client-paged page narrows its rows in the browser (a search or a chip the provider didn't see). |
| onFiltersChange | ((filters: FilterParam[]) => void) | — | |
| onLoadView | ((filters: Record<string, unknown>) => void) | — | |
| onNavigate | NavigateFn | — | Imperative navigation used only when `detail="route"` (navigates to `/{resource}/{id}` on row click). Defaults to a full-page navigation. Router consumers pass their navigate fn — e.g. RR `useNavigate()` or Next `router.push`. |
| onPageChange | ((page: number) => void) | — | Called with the next 1-based page number. The pager only renders when this is supplied AND both `perPage` and `total` are supplied — see {@link perPage} and {@link total}. Supplying this without either one renders an error naming the missing props instead of a pager. Status changes reach the server through `onFiltersChange` — not a dedicated callback here — because `statusFilter` state is tracked by the same filter machinery that already calls `onFiltersChange` regardless of controlled mode (see {@link statusFilter}). In server-controlled mode a status change also calls `onPageChange(1)` directly, since the previous page number is meaningless against a new filtered result set. |
| onPerPageChange | ((perPage: number) => void) | — | Called when the user picks a different page size in the header's view settings. |
| onQueryChange | ((query: { search: string; sort: SortParam | null; }) => void) | — | Hears the list's search and sort as they change (it only listens: the page keeps them). A saved view stores them from here. |
| onRetry | (() => void) | — | Server-data mode: invoked by the error panel's Retry button. The button only appears when this is supplied, so a caller with no way to retry simply omits it and gets an error panel without a dead control. In client-side mode the button is already wired to `useResource`'s own `refetch` and this prop is ignored. |
| onSaved | ((row: T, action: "create" | "edit") => void) | — | After the built-in form saves: the row and whether it was a create or an edit (to open a builder for a new row, say). A pessimistic save (the default) runs it once the server has the row, and gives that row with its key. An optimistic or undoable save runs it as the save is accepted, before the write lands: the values sent, no key for a create, and it isn't taken back by an undo. A `slotProps.form.onSuccess` replaces it; a `slots.form` runs it by calling its `onSuccess`. |
| onSaveView | ((name: string) => void) | — | |
| onSearchChange | ((search: string) => void) | — | Called when the user changes the search text (including clearing it). |
| onSortChange | ((sort: SortParam | null) => void) | — | Called when the user changes the sort, with `null` when the sort is cleared. |
| onViewModeChange | ((mode: ViewMode) => void) | — | Hears the view toggle, with `viewMode` or without. |
| openOnCardClick | boolean | — | With a custom `renderCard`: make each whole card (and list row) one keyboard-reachable button that opens the detail, so the card needs no `actions.open()` wiring and no hand-rolled `div role="button"`. Links and buttons inside the card keep their own clicks. Off by default, because an existing card that already calls `open()` would fire it twice. |
| page | number | — | Current page, 1-based. Server-controlled mode only. |
| pagerJumps | boolean | — | Opt-in. The pagers (this page's and the table's own) get first and last page buttons, the table's says "Page n of m", and the arrows are named "Previous page" / "Next page"; on a phone this page's pager shows only the arrows. Default false: the pagers draw as before. |
| pageSizeOptions | number[] | — | Page-size choices offered by `DataTable`'s own pager. Client-side mode only — server-controlled mode switches that pager off. (The header's view-settings popover has its own fixed 10/25/50/100 list.) |
| pagination | enum | — | How `resource` mode reaches rows past the first page. Ignored with `data` (server-data mode pages through the controlled props instead). - `"client"` (default): fetch up to `clientRowLimit` rows in one request and search, sort, filter and page them in the browser — header-click sort and instant search keep working. If the resource holds more rows than that, a notice under the list says how many are shown (and a console warning names this prop), rather than silently truncating. - `"server"`: fetch one page at a time. The pager under the list drives `useResource`'s page, the header's page size its `perPage`, and search / sort / status chips become provider queries (search is debounced), and the current page stays on screen while the next one loads. Give `statusFilter` explicit `options` here — derived ones can only see the current page's values. Search needs `searchFields` (or `resourceOptions.searchFields`) — the provider must be told which columns to match — so the search box is hidden without them. Table header sorting is withdrawn, as in server-data mode; the sort control in the filter row drives the query. - `"cursor"`: loads `perPage` rows (`resourceOptions.defaultPerPage`, else the stored page size) and a "Load more" button appends the next page, by cursor where the provider serves it (`capabilities().cursorPagination`) and by offset otherwise. The server orders by `resourceOptions.defaultSort`; search, sort and filters in the toolbar act on the rows loaded so far. |
| perPage | number | — | Rows per page the server was asked for. Required whenever `onPageChange` is supplied: pager math (total pages, range start, Next) cannot be inferred from `data.length`, because a short final page is smaller than the real page size. Wins over the per-user page size persisted by `viewSettingsKey` — an explicit prop always beats a stored preference. Required whenever `onPageChange` is supplied. A short final page (the server's last page returning fewer rows than its page size) is indistinguishable from a small page size — there is no correct way to infer the divisor from the rows handed back. Rather than guess and render a wrong range or a stuck Next button, the component refuses to render the pager and shows an error instead when `onPageChange` is present without `perPage`. `total` is required on the same terms — see {@link total}. The error names every missing prop, not just the first. |
| renderCard | ((item: T, index: number, actions: ResourceCardActions<T>) => ReactNode) | — | Override the default card renderer used for grid view (and, absent a dedicated list layout, list view too — DataGrid falls back to the same renderer there). ResourcePage still owns data-fetching, filtering, sorting, and layout (grid columns, infinite-scroll batching, stagger animation) — this only swaps what's rendered inside each item slot. Receives `ResourceCardActions`: the row's `update`/`remove`/`refetch` plus `open()` to activate the row (opening the configured detail panel/modal/route). Row activation is *not* applied automatically to a custom card — wrapping it would double-fire against cards that bring their own click handling and would hijack clicks on nested buttons — so call `actions.open()` from wherever your card should activate. |
| renderDetail | ((item: T) => ReactNode) | — | |
| renderForm | ((form: UseFormReturn<Record<string, unknown>>, fields: ResourceFormFieldDef[]) => ReactNode) | — | Custom form renderer — receives form instance and resolved fields. |
| renderTable | ((items: T[]) => ReactNode) | — | Replace the built-in `DataTable` that table view renders, keeping every other piece of the page — header, counts, view settings, filters, bulk bar, detail panel, form, pager — exactly as it is. The counterpart to `renderCard`, which does the same for grid and list view. Receives the rows for the current view, which in server-controlled mode is precisely the page the server returned. Ownership is total: row click-through, selection, density, column visibility and resizing are all things the built-in table wires for you and a custom table must wire for itself. That is the trade this prop makes, and it is why `renderCard` remains the lighter option when only the *cells* need to change — a `ResourceColumnDef.render` is lighter still. Omitted, the default `DataTable` render is used unchanged. |
| resizableColumns | boolean | — | Allow drag-resizing columns. DataTable's default is `true`. |
| resizeKey | string | — | Persist key for the user's column widths. |
| resource | string | — | Client-side mode: resource name passed to useResource / DataProvider. |
| resourceOptions | UseResourceOptions<T> | — | |
| restoreKey | string | number | — | The page starts again (its search, sort and status from `initialFilters`) when this changes: `useResourceViewProps` sets it when a saved view is restored, so a screen that renders its own `<ResourcePage {...props}>` picks the saved search and sort up as `<ResourceView>` does. |
| rowMenu | ((item: T, builtIn: ResourceRowMenuBuiltIn) => ResourceRowMenuItem[]) | — | A menu on each table row (ADR 0017 §2): a trailing "More" button and the same items on right-click. It gets the row and the page's own edit and delete for it (when the page offers them), so it can place them around its own items; an item with a `reason` shows disabled with those words. ResourceView builds it from the view's actions and guards. |
| savedViews | SavedViewItem[] | — | Saved filter views to offer. Pair with `useSavedViews` for per-user storage. |
| searchFields | string[] | — | |
| searchPlaceholder | string | — | |
| secondaryActions | PageHeaderAction[] | — | Extra header actions beyond the create button, in one overflow menu. See {@link PageHeaderAction} — the budget is one primary, the rest here. |
| slotProps | SlotPropsFor<ResourcePageSlotMap<T>> | — | Extra props merged into a part you are KEEPING. Wins over ours. |
| slots | ResourcePageSlots<T> | — | The interior parts `ResourcePage` composes, by name. Replace one with your own component, or pass `null` to eject it entirely — see {@link ResourcePageSlots}. This is the reason a surface that needs one part to differ does not have to drop to the primitives and re-derive the pagination, selection and detail wiring that were already correct. A `grid` replacement that draws its own items and should open them sets a static `opensItems = true` (as ResourceView's gallery does): it then gets `onItemClick` and `getItemLabel`, which open the row's detail. Without it, a grid slot gets them only with `openOnCardClick` and a `renderCard`, as before. |
| statusFilter | string | { field: string; options?: string[]; } | — | Adds a status-chip filter. There is no dedicated status-change callback: chip clicks update the same filter state that already reports through `onFiltersChange`, whether or not the page is in server-controlled mode. A caller combining `statusFilter` with server pagination (`onPageChange` et al.) must supply `onFiltersChange` — see that prop — or status changes will update the chip UI without ever reaching the server. In server-controlled mode a status change also resets to page 1 via `onPageChange(1)` — see {@link onPageChange}. |
| stickyFirstColumn | boolean | — | Keep the first column visible while scrolling horizontally. |
| stickyHeader | boolean | — | Keep the table header visible while scrolling. DataTable's default is `true`. |
| subtitle | string | — | Page subtitle shown below the title. |
| subtitleField | string | — | |
| titleField | string | — | |
| toolbar | ReactNode | — | |
| total | number | — | Server-data mode: total record count (before client-side filtering). Required whenever `onPageChange` is supplied. It cannot be derived from `data`, which holds only the current page. Omitted, `displayTotal` falls back to `0`, so the range span reads "No records" and `Next` stays disabled while the rows render directly below it. Rather than show a pager that contradicts the list, the component refuses to render the pager and shows an error instead. See {@link perPage} and {@link onPageChange}. |
| tree | ResourceTree<T> | — | Tree mode: rows nest under the row `getParentId` names, built from the flat rows by genesis-core's `treeRows` (docs/RESOURCE-VIEW.md, "Tree mode"). Sort applies within siblings, search and the status filter keep each match's ancestors, open state is controlled (`expanded`, `onExpandedChange`) or not (`defaultExpanded`), and `cascadeSelect` makes selecting a row select its descendants. Table and list views draw the indent and the expand arrow; grid and custom cards stay flat. Client data only: `pagination="client"` (the default) or `data`; server and cursor paging throw. |
| urlState | SearchParamsAdapter | ResourceUrlStateOptions | — | Keep the list's state in the URL: the open record (`?id=`), the search (`q`), the sort (`sort=field:asc`) and, with `pagination="server"`, the page. Pass your router's search-params adapter (`useReactRouterSearchParams()`, `useTanStackRouterSearchParams()`, or `useBrowserSearchParams()` with no router), or `{ searchParams, params }` to rename the keys. A copied link reopens the same record, and Back closes one that was opened. Search and sort are read when the page mounts and written as they change. A server-controlled page owns its own page, sort and search: use `useResourceUrlState` there. |
| variant | enum | — | `"page"` (default): a full list page. `"embedded"`: a list inside another page (a tab, a card, a side panel), whose page already has the heading, filters and shortcuts. Embedded sets, unless you set them: - `header="toolbar"`, showing only the create button, and the view toggle when there is a `renderCard`. No title, count, view settings or header options menu (`slotProps.shell.headerOptions` still win; an explicit `header="page"` keeps the full header); - no filter row, unless you pass `filters`, `statusFilter`, `searchFields` or saved views, or the list is already filtered (a search in the URL, say); - `keyboardNavigation={false}`, since j/k shortcuts belong to the page. |
| viewMode | enum | — | The view mode (`table`, `list`, `grid`), held by the caller: the person's stored pick is neither read nor written while it's set (ResourceView's type switcher holds it). |
| viewSettingsKey | string | — | Persist key for density / page size via `useViewSettings`. Defaults to `resource` or a slug of `title`. |